Share Extension: account picker first, hidden folders follow the app's filter + unlock
The app now publishes every uploadable account, the active one, the three lock settings and each account's own hidden-files filter (ShareAccountSync). The sheet lists accounts first when there are several, asks for unlock to use a non-active account (login lock + account-switching lock), and shows hidden folders per the account's app setting behind the hidden-files unlock. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
0cda4a1241
commit
a37524e959
+12
-5
@@ -61,11 +61,9 @@ void main() {
|
||||
ChangeNotifierProvider(
|
||||
create: (context) {
|
||||
final session = SessionController(context.read());
|
||||
// iOS's Share Extension has no Flutter engine; it picks its
|
||||
// folders/uploads as whichever account was last published here.
|
||||
session.addAccountReadyListener(
|
||||
() => ShareAccountService.publish(session),
|
||||
);
|
||||
// iOS's Share Extension has no Flutter engine; sign-out must wipe
|
||||
// what it was given. (Publishing happens in the shell - see
|
||||
// ShareAccountSync - once there's a FilesController to read.)
|
||||
session.addAccountClearedListener(ShareAccountService.clear);
|
||||
return session;
|
||||
},
|
||||
@@ -215,6 +213,7 @@ class _MainShellViewState extends State<MainShellView> {
|
||||
late final Map<AppTab, ScrollController> _scrollControllers;
|
||||
StreamSubscription<List<SharedFileRef>>? _shareSub;
|
||||
StreamSubscription<PickRequest>? _pickSub;
|
||||
ShareAccountSync? _shareAccountSync;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -236,6 +235,13 @@ class _MainShellViewState extends State<MainShellView> {
|
||||
ShareIntentService.getInitialShare().then(_handleSharedFiles);
|
||||
_shareSub = ShareIntentService.onNewShare.listen(_handleSharedFiles);
|
||||
|
||||
// iOS's Share Extension picks accounts/folders on its own, so it's kept
|
||||
// supplied with the accounts, lock settings and hidden-files filters.
|
||||
_shareAccountSync = ShareAccountSync(
|
||||
context.read<SessionController>(),
|
||||
context.read<FilesController>(),
|
||||
)..start();
|
||||
|
||||
// Same cold-start-vs-already-running split as the share intent above:
|
||||
// another app may have launched Noo as its GET_CONTENT picker.
|
||||
PickIntentService.getPickRequest().then((request) {
|
||||
@@ -320,6 +326,7 @@ class _MainShellViewState extends State<MainShellView> {
|
||||
}
|
||||
_shareSub?.cancel();
|
||||
_pickSub?.cancel();
|
||||
_shareAccountSync?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user