Browse Source

neon: fix login/logout routing

pull/342/head
Nikolas Rimikis 2 years ago
parent
commit
33619caf87
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 2
      packages/neon/neon/lib/src/pages/account_settings.dart
  2. 2
      packages/neon/neon/lib/src/pages/login.dart
  3. 4
      packages/neon/neon/lib/src/router.dart

2
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,

2
packages/neon/neon/lib/src/pages/login.dart

@ -84,6 +84,8 @@ class _LoginPageState extends State<LoginPage> {
..addAccount(account)
..setActiveAccount(account);
}
// ignore: use_build_context_synchronously
const HomeRoute().go(context);
} catch (e, s) {
debugPrint(e.toString());
debugPrint(s.toString());

4
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,

Loading…
Cancel
Save