Merge pull request #705 from ente-io/2fa-toggle-bug-fix

2FA toggle switch bug fix
This commit is contained in:
Neeraj Gupta 2022-12-15 09:25:39 +05:30 committed by GitHub
commit 59ad671ee2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,6 +68,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
@override
void dispose() {
WidgetsBinding.instance.removeObserver(_lifecycleEventHandler);
widget.completer.isCompleted ? null : widget.completer.complete();
super.dispose();
}
@ -266,7 +267,6 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
.enableTwoFactor(context, widget.secretCode, code);
if (success) {
_showSuccessPage();
widget.completer.complete();
}
}