mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-18 05:51:34 +02:00
Cw-410 Null Issue With 2FA (#960)
* chore: Setup * hotfix: null check operator used when totp arguments are null causing issues * hotfix: null check operator used when totp arguments are null causing issues * hotfix: null check operator used when totp arguments are null causing issues * hotfix: null check operator used when totp arguments are null causing issues * fix: Review changes --------- Co-authored-by: David Adegoke <blazebrain@Davids-MacBook-Pro.local>
This commit is contained in:
co-authored by
David Adegoke
parent
8747d2fe59
commit
3b073d9751
@@ -43,26 +43,24 @@ class TotpAuthCodePageState extends State<TotpAuthCodePage> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_reaction ??= reaction((_) => widget.setup2FAViewModel.state, (ExecutionState state) {
|
||||
if (state is ExecutedSuccessfullyState) {
|
||||
if(widget.totpArguments.onTotpAuthenticationFinished != null) {
|
||||
_reaction ??= reaction((_) => widget.setup2FAViewModel.state, (ExecutionState state) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
widget.totpArguments.onTotpAuthenticationFinished!(true, this);
|
||||
});
|
||||
}
|
||||
if (state is ExecutedSuccessfullyState) {
|
||||
widget.totpArguments.onTotpAuthenticationFinished!(true, this);
|
||||
}
|
||||
|
||||
if (state is FailureState) {
|
||||
print(state.error);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
widget.totpArguments.onTotpAuthenticationFinished!(false, this);
|
||||
});
|
||||
}
|
||||
if (state is FailureState) {
|
||||
print(state.error);
|
||||
widget.totpArguments.onTotpAuthenticationFinished!(false, this);
|
||||
}
|
||||
|
||||
if (state is AuthenticationBanned) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
widget.totpArguments.onTotpAuthenticationFinished!(false, this);
|
||||
});
|
||||
}
|
||||
if (state is AuthenticationBanned) {
|
||||
widget.totpArguments.onTotpAuthenticationFinished!(false, this);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user