mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-12 11:24:08 +00:00
fix(android): via browser takeover handling (#1489)
This commit is contained in:
5 files changed
+90
-3
No files matched your search
@@ -37,10 +37,15 @@ class AppDeepLinkController extends AsyncNotifier<AppDeepLinkState> {
|
||||
|
||||
@override
|
||||
Future<AppDeepLinkState> build() async {
|
||||
final runtime = ref.watch(appRuntimeControllerProvider).value;
|
||||
if (runtime == null || _started || kIsWeb) {
|
||||
if (_started || kIsWeb) {
|
||||
return AppDeepLinkState(started: _started);
|
||||
}
|
||||
// Deep-link handling depends on the runtime being ready, but it must not
|
||||
// rebuild whenever runtime settings change. A rebuild disposes the active
|
||||
// platform subscriptions while `_started` remains true, leaving Android
|
||||
// unable to receive later browser takeover intents (for example after the
|
||||
// API server is started or stopped from Settings).
|
||||
await ref.read(appRuntimeControllerProvider.future);
|
||||
_started = true;
|
||||
final appLinks = AppLinks();
|
||||
_subscription = appLinks.uriLinkStream.listen((uri) {
|
||||
|
||||
Reference in new issue
Block a user