mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-13 09:20:31 -07:00
[Bugfix] Mobile - Fixed navigating back to splash screen (#11)
Fixes a small bug where the user could navigate back to the splashscreen when starting the app. Also fixes switching users and going back from the login screen. Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
5e882b2177
commit
c53b9b2281
3 changed files with 4 additions and 4 deletions
|
|
@ -131,7 +131,7 @@ class AuthGuard extends AutoRouteGuard {
|
||||||
if (value) {
|
if (value) {
|
||||||
resolver.next(true);
|
resolver.next(true);
|
||||||
} else {
|
} else {
|
||||||
router.navigate(const LoginRoute());
|
router.replace(const LoginRoute());
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ class _LoginPageState extends ConsumerState<LoginScreen> {
|
||||||
void loggedInGoToHome() {
|
void loggedInGoToHome() {
|
||||||
ref.read(lockScreenActiveProvider.notifier).update((state) => false);
|
ref.read(lockScreenActiveProvider.notifier).update((state) => false);
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.router.navigate(const DashboardRoute());
|
context.router.replaceAll([const DashboardRoute()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
||||||
tooltip: context.localized.switchUser,
|
tooltip: context.localized.switchUser,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await ref.read(userProvider.notifier).logoutUser();
|
await ref.read(userProvider.notifier).logoutUser();
|
||||||
context.router.navigate(const LoginRoute());
|
context.router.replaceAll([const LoginRoute()]);
|
||||||
},
|
},
|
||||||
child: const Icon(
|
child: const Icon(
|
||||||
IconsaxOutline.arrow_swap_horizontal,
|
IconsaxOutline.arrow_swap_horizontal,
|
||||||
|
|
@ -208,7 +208,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await ref.read(authProvider.notifier).logOutUser();
|
await ref.read(authProvider.notifier).logOutUser();
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.router.navigate(const LoginRoute());
|
context.router.replaceAll([const LoginRoute()]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(context.localized.logout),
|
child: Text(context.localized.logout),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue