From 33619caf87a5ba8574e3cd0f1dd8395327d2cd57 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Fri, 26 May 2023 21:05:32 +0200 Subject: [PATCH] neon: fix login/logout routing --- packages/neon/neon/lib/src/pages/account_settings.dart | 2 ++ packages/neon/neon/lib/src/pages/login.dart | 2 ++ packages/neon/neon/lib/src/router.dart | 4 ---- 3 files changed, 4 insertions(+), 4 deletions(-) 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,