🐛 Fix file upload

This commit is contained in:
2025-09-24 20:29:30 +08:00
parent 457d1bac60
commit 5f84751fd5
4 changed files with 9 additions and 36 deletions

View File

@@ -935,7 +935,7 @@ class _ChatAttachmentUploaderSheetState
if (snapshot.hasError) {
return Center(child: Text('errorLoadingPools'.tr()));
}
final pools = snapshot.data!.filterValid();
final pools = snapshot.data!;
selectedPoolId ??= resolveDefaultPoolId(widget.ref, pools);
return Column(
@@ -1162,9 +1162,7 @@ class _ChatAttachmentUploaderSheetState
// Get the selected pool to check constraints
final pools = await widget.ref.read(poolsProvider.future);
final selectedPool = pools.filterValid().firstWhere(
(p) => p.id == selectedPoolId,
);
final selectedPool = pools.firstWhere((p) => p.id == selectedPoolId);
// Check constraints
final maxFileSize = selectedPool.policyConfig?['max_file_size'] as int?;