diff --git a/packages/harbour/lib/app.dart b/packages/harbour/lib/app.dart index c13ecdfe..0d89b023 100644 --- a/packages/harbour/lib/app.dart +++ b/packages/harbour/lib/app.dart @@ -50,6 +50,9 @@ class _HarbourAppState extends State with WidgetsBindingObserver { } else { await _navigatorKey.currentState!.pushAndRemoveUntil( MaterialPageRoute( + settings: const RouteSettings( + name: 'home', + ), builder: (final context) => HomePage( account: activeAccount, onThemeChanged: (final theme) { diff --git a/packages/harbour/lib/src/blocs/apps.dart b/packages/harbour/lib/src/blocs/apps.dart index 9a388185..3bb6d60f 100644 --- a/packages/harbour/lib/src/blocs/apps.dart +++ b/packages/harbour/lib/src/blocs/apps.dart @@ -31,7 +31,7 @@ class AppsBloc extends $AppsBloc { _$refreshEvent.listen((final _) => _loadApps); _$setActiveAppEvent.listen((final appId) async { final data = (await _appImplementationsSubject.firstWhere((final result) => result.data != null)).data!; - if (data.where((final app) => app.id == appId).isNotEmpty) { + if (data.where((final app) => app.id == appId).isNotEmpty && _activeAppSubject.valueOrNull != appId) { _activeAppSubject.add(appId); } }); diff --git a/packages/harbour/lib/src/pages/home/home.dart b/packages/harbour/lib/src/pages/home/home.dart index 81ee4161..f62a8736 100644 --- a/packages/harbour/lib/src/pages/home/home.dart +++ b/packages/harbour/lib/src/pages/home/home.dart @@ -157,6 +157,7 @@ class _HomePageState extends State with tray.TrayListener, WindowListe if (matches.isNotEmpty) { final appId = matches[0].group(1); _appsBloc.setActiveApp(appId); + Navigator.of(context).popUntil((final route) => route.settings.name == 'home'); if (_platform.canUseWindowManager) { await _showAndRestoreWindow(); }