mirror of
https://github.com/zapstore/zapstore.git
synced 2026-10-05 12:38:24 +00:00
fix: Refactor auto sign-out logic for Amber uninstallation
Reorganize the sign-out process to ensure the toast notification is displayed after a successful sign-out.
This commit is contained in:
+11
-14
@@ -112,21 +112,18 @@ class ZapstoreApp extends HookConsumerWidget {
|
|||||||
if (previous != true || isAmberInstalled) return;
|
if (previous != true || isAmberInstalled) return;
|
||||||
if (ref.read(Signer.activePubkeyProvider) == null) return;
|
if (ref.read(Signer.activePubkeyProvider) == null) return;
|
||||||
|
|
||||||
final toastContext = rootNavigatorKey.currentState?.overlay?.context;
|
unawaited(() async {
|
||||||
if (toastContext != null && toastContext.mounted) {
|
try {
|
||||||
toastContext.showInfo('Amber was removed, you were signed out');
|
await ref.read(amberSignerProvider).signOut();
|
||||||
}
|
|
||||||
|
|
||||||
unawaited(
|
final toastContext = rootNavigatorKey.currentState?.overlay?.context;
|
||||||
ref
|
if (toastContext != null && toastContext.mounted) {
|
||||||
.read(amberSignerProvider)
|
toastContext.showInfo('Amber was removed, you were signed out');
|
||||||
.signOut()
|
}
|
||||||
.catchError(
|
} catch (error) {
|
||||||
(Object error, StackTrace stackTrace) => debugPrint(
|
debugPrint('Auto sign-out after Amber uninstall failed: $error');
|
||||||
'Auto sign-out after Amber uninstall failed: $error',
|
}
|
||||||
),
|
}());
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user