feat(extensions): manual verification help when browser launch fails

Expose a root navigator for global dialogs, show a fallback help sheet
with copy and reopen actions when verification URLs cannot launch, and
schedule the same prompt after a timeout during pending grants.
This commit is contained in:
zarzet
2026-07-01 11:24:07 +07:00
parent 4d6f7d8b08
commit dcfd95f276
5 changed files with 180 additions and 22 deletions
+24 -7
View File
@@ -2096,14 +2096,31 @@ class DownloadQueueNotifier extends Notifier<DownloadQueueState> {
),
);
final opened = await openPendingExtensionVerification(
normalizedExtensionId,
browserMode: ref.read(settingsProvider).extensionVerificationBrowserMode,
);
if (!opened) return false;
final browserMode = ref
.read(settingsProvider)
.extensionVerificationBrowserMode;
Uri? authUri;
Timer? helpDialogTimer;
final event = await grantEventFuture;
return event.success;
try {
final opened = await openPendingExtensionVerification(
normalizedExtensionId,
browserMode: browserMode,
onAuthUri: (uri) => authUri = uri,
);
if (!opened) return false;
helpDialogTimer = scheduleExtensionVerificationHelpDialog(
normalizedExtensionId,
authUri,
browserMode: browserMode,
);
final event = await grantEventFuture;
return event.success;
} finally {
helpDialogTimer?.cancel();
}
}
Future<bool> _handleVerificationRequiredDownload(
+15 -3
View File
@@ -683,15 +683,26 @@ class TrackNotifier extends Notifier<TrackState> {
}
});
final browserMode = ref
.read(settingsProvider)
.extensionVerificationBrowserMode;
Uri? authUri;
Timer? helpDialogTimer;
try {
final opened = await openPendingExtensionVerification(
normalizedExtensionId,
browserMode: ref
.read(settingsProvider)
.extensionVerificationBrowserMode,
browserMode: browserMode,
onAuthUri: (uri) => authUri = uri,
);
if (!opened) return false;
helpDialogTimer = scheduleExtensionVerificationHelpDialog(
normalizedExtensionId,
authUri,
browserMode: browserMode,
);
final event = await grantCompleter.future.timeout(
const Duration(minutes: 5),
);
@@ -702,6 +713,7 @@ class TrackNotifier extends Notifier<TrackState> {
);
return false;
} finally {
helpDialogTimer?.cancel();
await grantSub.cancel();
}
}