feat: replace mail protocol with smolmail and rebuild the UI
This commit is contained in:
parent
cb24b68069
commit
e94e4158cc
93 changed files with 6387 additions and 3479 deletions
23
lib/presentation/routes/home_guard.dart
Normal file
23
lib/presentation/routes/home_guard.dart
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import "package:auto_route/auto_route.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
|
||||
import "package:smol_mail/data/providers/providers.dart";
|
||||
import "package:smol_mail/presentation/routes/app_router.gr.dart";
|
||||
|
||||
/// The landing screen is only for users who cannot use the app yet: no
|
||||
/// identity, or no registered account.
|
||||
class HomeGuard extends AutoRouteGuard {
|
||||
final WidgetRef ref;
|
||||
|
||||
HomeGuard(this.ref);
|
||||
|
||||
@override
|
||||
void onNavigation(NavigationResolver resolver, StackRouter router) {
|
||||
if (ref.read(identityProvider) != null &&
|
||||
ref.read(accountProvider) != null) {
|
||||
router.replace(InboxRoute());
|
||||
} else {
|
||||
resolver.next(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue