Remove unused state 'denied' from authentication state [skip ci]
OmarHatem committed
Dec 5, 2022 at 18:40 UTC
d19f7b6d3896e39cd906c08bd7eb4358df661f70
2 files changed
+1
-9
lib/reactions/on_authentication_state_change.dart
-5
@@ -26,10 +26,5 @@ void startAuthenticationStateChange(AuthenticationStore authenticationStore,
26
await navigatorKey.currentState!.pushNamedAndRemoveUntil(Routes.dashboard, (route) => false);
27
return;
28
}
29
-
30
- if (state == AuthenticationState.denied) {
31
- await navigatorKey.currentState!.pushNamedAndRemoveUntil(Routes.welcome, (_) => false);
32
- return;
33
- }
29
});
30
}
lib/store/authentication_store.dart
+1
-4
@@ -4,7 +4,7 @@ part 'authentication_store.g.dart';
4
5
class AuthenticationStore = AuthenticationStoreBase with _$AuthenticationStore;
6
7
-enum AuthenticationState { uninitialized, installed, allowed, denied }
7
+enum AuthenticationState { uninitialized, installed, allowed }
8
9
abstract class AuthenticationStoreBase with Store {
10
AuthenticationStoreBase() : state = AuthenticationState.uninitialized;
@@ -17,7 +17,4 @@ abstract class AuthenticationStoreBase with Store {
17
18
@action
19
void allowed() => state = AuthenticationState.allowed;
20
-
21
- @action
22
- void denied() => state = AuthenticationState.denied;
20
}