mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-06 04:37:59 +02:00
fix(extensions): default verification browser to in-app first
Prefer the in-app browser for signed-session verification challenges, normalize invalid saved modes to the new default, and keep the help dialog modal until the user explicitly dismisses it.
This commit is contained in:
@@ -129,7 +129,7 @@ class AppSettings {
|
||||
this.singleFilenameFormat = '{title} - {artist}',
|
||||
this.albumFolderStructure = 'artist_album',
|
||||
this.showExtensionStore = true,
|
||||
this.extensionVerificationBrowserMode = 'external_first',
|
||||
this.extensionVerificationBrowserMode = 'in_app_first',
|
||||
this.locale = 'system',
|
||||
this.lyricsMode = 'embed',
|
||||
this.tidalHighFormat = 'mp3_320',
|
||||
|
||||
@@ -49,7 +49,7 @@ AppSettings _$AppSettingsFromJson(Map<String, dynamic> json) => AppSettings(
|
||||
json['albumFolderStructure'] as String? ?? 'artist_album',
|
||||
showExtensionStore: json['showExtensionStore'] as bool? ?? true,
|
||||
extensionVerificationBrowserMode:
|
||||
json['extensionVerificationBrowserMode'] as String? ?? 'external_first',
|
||||
json['extensionVerificationBrowserMode'] as String? ?? 'in_app_first',
|
||||
locale: json['locale'] as String? ?? 'system',
|
||||
lyricsMode: json['lyricsMode'] as String? ?? 'embed',
|
||||
tidalHighFormat: json['tidalHighFormat'] as String? ?? 'mp3_320',
|
||||
|
||||
@@ -283,7 +283,7 @@ class SettingsNotifier extends Notifier<AppSettings> {
|
||||
if (_extensionVerificationBrowserModeValues.contains(normalized)) {
|
||||
return normalized;
|
||||
}
|
||||
return 'external_first';
|
||||
return 'in_app_first';
|
||||
}
|
||||
|
||||
String? _sanitizeRetiredBuiltInProviderId(String? providerId) {
|
||||
|
||||
@@ -394,7 +394,9 @@ class _VerificationBrowserModeSelector extends StatelessWidget {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final normalizedMode = currentMode == 'in_app_first'
|
||||
? 'in_app_first'
|
||||
: 'external_first';
|
||||
: currentMode == 'external_first'
|
||||
? 'external_first'
|
||||
: 'in_app_first';
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
@@ -35,7 +35,7 @@ bool _containsHttpStatusCode(String message, String code) {
|
||||
|
||||
Future<bool> openPendingExtensionVerification(
|
||||
String extensionId, {
|
||||
String browserMode = 'external_first',
|
||||
String browserMode = 'in_app_first',
|
||||
void Function(Uri authUri)? onAuthUri,
|
||||
}) async {
|
||||
final normalizedExtensionId = extensionId.trim();
|
||||
@@ -79,7 +79,7 @@ Future<bool> openPendingExtensionVerification(
|
||||
Timer? scheduleExtensionVerificationHelpDialog(
|
||||
String extensionId,
|
||||
Uri? authUri, {
|
||||
String browserMode = 'external_first',
|
||||
String browserMode = 'in_app_first',
|
||||
Duration delay = const Duration(seconds: 20),
|
||||
}) {
|
||||
final normalizedExtensionId = extensionId.trim();
|
||||
@@ -99,7 +99,7 @@ Timer? scheduleExtensionVerificationHelpDialog(
|
||||
Future<bool> showExtensionVerificationHelpDialog(
|
||||
String extensionId,
|
||||
Uri authUri, {
|
||||
String browserMode = 'external_first',
|
||||
String browserMode = 'in_app_first',
|
||||
bool immediateFailure = false,
|
||||
}) async {
|
||||
final context = AppNavigationService.rootNavigatorKey.currentContext;
|
||||
@@ -119,6 +119,7 @@ Future<bool> showExtensionVerificationHelpDialog(
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
useRootNavigator: true,
|
||||
barrierDismissible: false,
|
||||
builder: (dialogContext) {
|
||||
final dialogL10n = dialogContext.l10n;
|
||||
return AlertDialog(
|
||||
|
||||
Reference in New Issue
Block a user