mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 13:19:44 +02:00
fix: retry verification browser launch and failed searches
This commit is contained in:
1 parent
ba44bafa92
commit
39273edd85
4 files changed
+204
-4
No files matched your search
@@ -480,9 +480,16 @@ Future<bool> _launchVerificationUrl(Uri uri, String browserMode) async {
|
||||
? LaunchMode.externalApplication
|
||||
: LaunchMode.inAppBrowserView;
|
||||
|
||||
var launched = await launchUrl(uri, mode: firstMode);
|
||||
if (!launched) {
|
||||
launched = await launchUrl(uri, mode: fallbackMode);
|
||||
for (final mode in [firstMode, fallbackMode]) {
|
||||
try {
|
||||
if (await launchUrl(uri, mode: mode)) return true;
|
||||
} on PlatformException catch (error) {
|
||||
// Android reports some launch failures as exceptions rather than false.
|
||||
// Keep the other mode and manual verification help available in both cases.
|
||||
_log.w(
|
||||
'Verification browser launch failed (${mode.name}): ${error.code}',
|
||||
);
|
||||
}
|
||||
}
|
||||
return launched;
|
||||
return false;
|
||||
}
|
||||
Reference in new issue
Block a user