add default pool selection with validation and fallback
- extend AppSettings with defaultPoolId - add pool filtering utility to exclude media-only pools - add resolveDefaultPoolId with fallback to safe pool - update SettingsScreen with default pool dropdown - integrate uploadAttachment with default pool resolution Signed-off-by: Texas0295 <kimura@texas0295.top>
This commit is contained in:
@@ -20,6 +20,8 @@ import 'package:island/widgets/alert.dart';
|
||||
import 'package:island/widgets/post/compose_link_attachments.dart';
|
||||
import 'package:island/widgets/post/compose_poll.dart';
|
||||
import 'package:island/widgets/post/compose_recorder.dart';
|
||||
import 'package:island/pods/pool_provider.dart';
|
||||
import 'package:island/utils/pool_utils.dart';
|
||||
import 'package:pasteboard/pasteboard.dart';
|
||||
import 'package:textfield_tags/textfield_tags.dart';
|
||||
import 'dart:async';
|
||||
@@ -522,8 +524,8 @@ class ComposeLogic {
|
||||
|
||||
SnCloudFile? cloudFile;
|
||||
|
||||
final settings = ref.watch(appSettingsNotifierProvider);
|
||||
final selectedPoolId = poolId ?? settings.defaultPoolId ?? '500e5ed8-bd44-4359-bc0a-ec85e2adf447';
|
||||
final pools = await ref.read(poolsProvider.future);
|
||||
final selectedPoolId = resolveDefaultPoolId(ref, pools);
|
||||
if (attachment.type == UniversalFileType.file) {
|
||||
cloudFile =
|
||||
await putFileToPool(
|
||||
|
Reference in New Issue
Block a user