diff --git a/lib/app/views/main_page.dart b/lib/app/views/main_page.dart index c94e435a..dbe5ac90 100755 --- a/lib/app/views/main_page.dart +++ b/lib/app/views/main_page.dart @@ -27,16 +27,13 @@ import '../../fido/views/passkeys_screen.dart'; import '../../fido/views/webauthn_page.dart'; import '../../home/views/home_message_page.dart'; import '../../home/views/home_screen.dart'; -import '../../management/views/management_screen.dart'; import '../../oath/views/oath_screen.dart'; import '../../oath/views/utils.dart'; import '../../otp/views/otp_screen.dart'; import '../../piv/views/piv_screen.dart'; -import '../message.dart'; import '../models.dart'; import '../state.dart'; import 'device_error_screen.dart'; -import 'message_page.dart'; class MainPage extends ConsumerWidget { const MainPage({super.key}); @@ -131,41 +128,6 @@ class MainPage extends ConsumerWidget { return ref.watch(currentDeviceDataProvider).when( data: (data) { final section = ref.watch(currentSectionProvider); - final capabilities = section.capabilities; - if (section.getAvailability(data) == Availability.unsupported) { - return MessagePage( - title: section.getDisplayName(l10n), - capabilities: capabilities, - header: l10n.s_app_not_supported, - message: l10n.l_app_not_supported_on_yk(capabilities - .map((c) => c.getDisplayName(l10n)) - .join(',')), - ); - } else if (section.getAvailability(data) != - Availability.enabled) { - return MessagePage( - title: section.getDisplayName(l10n), - capabilities: capabilities, - header: l10n.s_app_disabled, - message: l10n.l_app_disabled_desc(capabilities - .map((c) => c.getDisplayName(l10n)) - .join(',')), - actionsBuilder: (context, expanded) => [ - ActionChip( - label: Text(data.info.version.major > 4 - ? l10n.s_toggle_applications - : l10n.s_toggle_interfaces), - onPressed: () async { - await showBlurDialog( - context: context, - builder: (context) => ManagementScreen(data), - ); - }, - avatar: const Icon(Symbols.construction), - ) - ], - ); - } return switch (section) { Section.home => HomeScreen(data), diff --git a/lib/desktop/state.dart b/lib/desktop/state.dart index a0de9c64..3a383b7a 100755 --- a/lib/desktop/state.dart +++ b/lib/desktop/state.dart @@ -261,15 +261,10 @@ class DesktopCurrentSectionNotifier extends CurrentSectionNotifier { state.getAvailability(data) != Availability.enabled) { state = Section.passkeys; } - if (state.getAvailability(data) != Availability.unsupported) { - // Keep current app - return; + if (state.getAvailability(data) != Availability.enabled) { + // Default to home if app is not enabled + state = Section.home; } - - state = _supportedSections.firstWhere( - (app) => app.getAvailability(data) == Availability.enabled, - orElse: () => _supportedSections.first, - ); } static Section _fromName(String? name, List
supportedSections) => diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 58eef40b..1e6bbce2 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -203,7 +203,6 @@ "app": {} } }, - "s_app_disabled": "Anwendung deaktiviert", "l_app_disabled_desc": "Aktivieren Sie die Anwendung '{app}' auf Ihrem YubiKey für Zugriff", "@l_app_disabled_desc": { "placeholders": { diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 2f4efa75..e403ea67 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -203,7 +203,6 @@ "app": {} } }, - "s_app_disabled": "Application disabled", "l_app_disabled_desc": "Enable the '{app}' application on your YubiKey to access", "@l_app_disabled_desc": { "placeholders": { diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index b4cf1b09..d1f0300c 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -203,7 +203,6 @@ "app": {} } }, - "s_app_disabled": "Application désactivée", "l_app_disabled_desc": "Activez l'application {app} sur votre YubiKey pour y accéder", "@l_app_disabled_desc": { "placeholders": { diff --git a/lib/l10n/app_ja.arb b/lib/l10n/app_ja.arb index 2eb46bac..a7d59214 100644 --- a/lib/l10n/app_ja.arb +++ b/lib/l10n/app_ja.arb @@ -203,7 +203,6 @@ "app": {} } }, - "s_app_disabled": "アプリケーションが無効です", "l_app_disabled_desc": "アクセスするにはYubiKeyで{app}アプリケーションを有効にしてください", "@l_app_disabled_desc": { "placeholders": { diff --git a/lib/l10n/app_pl.arb b/lib/l10n/app_pl.arb index b829bdae..3855cbf3 100644 --- a/lib/l10n/app_pl.arb +++ b/lib/l10n/app_pl.arb @@ -203,7 +203,6 @@ "app": {} } }, - "s_app_disabled": "Aplikacja została wyłączona", "l_app_disabled_desc": "Włącz aplikację '{app}' w kluczu YubiKey, aby uzyskać do niej dostęp", "@l_app_disabled_desc": { "placeholders": { diff --git a/lib/l10n/app_vi.arb b/lib/l10n/app_vi.arb index 3c16a010..7c5c2b61 100644 --- a/lib/l10n/app_vi.arb +++ b/lib/l10n/app_vi.arb @@ -203,7 +203,6 @@ "app": {} } }, - "s_app_disabled": "Ứng dụng đã bị tắt", "l_app_disabled_desc": "Bật ứng dụng '{app}' trên YubiKey của bạn để truy cập", "@l_app_disabled_desc": { "placeholders": {