diff --git a/packages/neon/neon/lib/src/pages/account_settings.dart b/packages/neon/neon/lib/src/pages/account_settings.dart index 11813dbb..29a1057d 100644 --- a/packages/neon/neon/lib/src/pages/account_settings.dart +++ b/packages/neon/neon/lib/src/pages/account_settings.dart @@ -29,6 +29,8 @@ class AccountSettingsPage extends StatelessWidget { AppLocalizations.of(context).accountOptionsRemoveConfirm(account.client.humanReadableID), )) { bloc.removeAccount(account); + // ignore: use_build_context_synchronously + const HomeRoute().go(context); } }, tooltip: AppLocalizations.of(context).accountOptionsRemove, diff --git a/packages/neon/neon/lib/src/pages/login.dart b/packages/neon/neon/lib/src/pages/login.dart index b3ed5c2d..a7715cbf 100644 --- a/packages/neon/neon/lib/src/pages/login.dart +++ b/packages/neon/neon/lib/src/pages/login.dart @@ -84,6 +84,8 @@ class _LoginPageState extends State { ..addAccount(account) ..setActiveAccount(account); } + // ignore: use_build_context_synchronously + const HomeRoute().go(context); } catch (e, s) { debugPrint(e.toString()); debugPrint(s.toString()); diff --git a/packages/neon/neon/lib/src/router.dart b/packages/neon/neon/lib/src/router.dart index d6c397c5..8491fde9 100644 --- a/packages/neon/neon/lib/src/router.dart +++ b/packages/neon/neon/lib/src/router.dart @@ -21,10 +21,6 @@ class AppRouter extends GoRouter { return const LoginRoute().location; } - if (state.location == const LoginRoute().location) { - return const HomeRoute().location; - } - return null; }, routes: $appRoutes,