mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 01:47:41 +00:00
44a9ad7487
Fix auth state not triggering onAuthState changed due to same value
26 lines
629 B
Dart
26 lines
629 B
Dart
import 'package:mobx/mobx.dart';
|
|
|
|
part 'authentication_store.g.dart';
|
|
|
|
class AuthenticationStore = AuthenticationStoreBase with _$AuthenticationStore;
|
|
|
|
enum AuthenticationState { uninitialized, installed, allowed, _reset }
|
|
|
|
abstract class AuthenticationStoreBase with Store {
|
|
AuthenticationStoreBase() : state = AuthenticationState.uninitialized;
|
|
|
|
@observable
|
|
AuthenticationState state;
|
|
|
|
@action
|
|
void installed() {
|
|
state = AuthenticationState._reset;
|
|
state = AuthenticationState.installed;
|
|
}
|
|
|
|
@action
|
|
void allowed() {
|
|
state = AuthenticationState._reset;
|
|
state = AuthenticationState.allowed;
|
|
}
|
|
}
|