Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix routing

AmanRajSinghMourya7de074f262f8
diff --git a/mobile/packages/accounts/lib/services/user_service.dart b/mobile/packages/accounts/lib/services/user_service.dart
index ca02a84372..11707b2ba4 100644
--- a/mobile/packages/accounts/lib/services/user_service.dart
+++ b/mobile/packages/accounts/lib/services/user_service.dart
@@ -276,8 +276,9 @@ class UserService {
final response = await _enteDio.post("/users/logout");
if (response.statusCode == 200) {
await _config.logout();
- unawaited(Navigator.of(context)
- .pushNamedAndRemoveUntil('/', (route) => false),);
+ unawaited(
+ Navigator.of(context).pushNamedAndRemoveUntil('/', (route) => false),
+ );
} else {
throw Exception("Log out action failed");
}
@@ -286,8 +287,9 @@ class UserService {
// check if token is already invalid
if (e is DioException && e.response?.statusCode == 401) {
await _config.logout();
- unawaited(Navigator.of(context)
- .pushNamedAndRemoveUntil('/', (route) => false),);
+ unawaited(
+ Navigator.of(context).pushNamedAndRemoveUntil('/', (route) => false),
+ );
return;
}
//This future is for waiting for the dialog from which logout() is called
@@ -828,7 +830,9 @@ class UserService {
return page!;
},
),
- (route) => route.isFirst,
+ identical(page, _homePage)
+ ? (route) => false
+ : (route) => route.isFirst,
);
} else {
// should never reach here