mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-06-05 21:29:27 -04:00
remove some stuff
This commit is contained in:
parent
d39c9343b7
commit
0bc9dc3ad4
4 changed files with 15 additions and 89 deletions
|
@ -21,7 +21,7 @@ import '../state/auth.dart';
|
|||
class RouterNotifier extends AutoDisposeAsyncNotifier<void>
|
||||
implements Listenable {
|
||||
VoidCallback? routerListener;
|
||||
bool isAuth = false; // Useful for our global redirect functio
|
||||
bool isAuth = false; // Useful for our global redirect function
|
||||
|
||||
@override
|
||||
Future<void> build() async {
|
||||
|
@ -43,13 +43,14 @@ class RouterNotifier extends AutoDisposeAsyncNotifier<void>
|
|||
if (this.state.isLoading || this.state.hasError) return null;
|
||||
|
||||
final isIndex = state.location == IndexPage.path;
|
||||
|
||||
if (isIndex) {
|
||||
return isAuth ? HomePage.path : LoginPage.path;
|
||||
}
|
||||
|
||||
final isLoggingIn = state.location == LoginPage.path;
|
||||
if (isLoggingIn) return isAuth ? HomePage.path : null;
|
||||
if (isLoggingIn) {
|
||||
return isAuth ? HomePage.path : null;
|
||||
}
|
||||
|
||||
return isAuth ? null : IndexPage.path;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue