mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
chore: fix routes not working when initially signing in
This commit is contained in:
parent
1c56617955
commit
4ea0523692
@ -14,21 +14,6 @@ class AppRouter extends RootStackRouter {
|
||||
|
||||
AppRouter(this.ref) : super(navigatorKey: rootNavigatorKey);
|
||||
|
||||
@override
|
||||
List<AutoRouteGuard> get guards => [
|
||||
AutoRouteGuardCallback(
|
||||
(resolver, router) async {
|
||||
final auth = await ref.read(authenticationProvider.future);
|
||||
|
||||
if (auth == null && !KVStoreService.doneGettingStarted) {
|
||||
resolver.redirect(const GettingStartedRoute());
|
||||
} else {
|
||||
resolver.next(true);
|
||||
}
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
@override
|
||||
List<AutoRoute> get routes => [
|
||||
AutoRoute(
|
||||
@ -40,6 +25,19 @@ class AppRouter extends RootStackRouter {
|
||||
path: "home",
|
||||
page: HomeRoute.page,
|
||||
initial: true,
|
||||
guards: [
|
||||
AutoRouteGuardCallback(
|
||||
(resolver, router) async {
|
||||
final auth = await ref.read(authenticationProvider.future);
|
||||
|
||||
if (auth == null && !KVStoreService.doneGettingStarted) {
|
||||
resolver.redirect(const GettingStartedRoute());
|
||||
} else {
|
||||
resolver.next(true);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
AutoRoute(
|
||||
path: "home/genres",
|
||||
|
Loading…
Reference in New Issue
Block a user