mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39:22 +00:00
Cw 218 fix change pin using bio auth (#599)
* - push change pin page as a replacement for auth page to avoid closing it once its opened - Add cool-down duration after popping flushbars and pushing new routes
This commit is contained in:
parent
2696c242a9
commit
71444219be
3 changed files with 19 additions and 19 deletions
|
@ -252,4 +252,4 @@ SPEC CHECKSUMS:
|
|||
|
||||
PODFILE CHECKSUM: ae71bdf0eb731a1ffc399c122f6aa4dea0cb5f6f
|
||||
|
||||
COCOAPODS: 1.11.2
|
||||
COCOAPODS: 1.11.3
|
||||
|
|
|
@ -106,22 +106,22 @@ class AuthPageState extends State<AuthPage> {
|
|||
_progressBar = null;
|
||||
}
|
||||
|
||||
Future<void> close({String? route}) async {
|
||||
Future<void> close({String? route, dynamic arguments}) async {
|
||||
if (_key.currentContext == null) {
|
||||
throw Exception('Key context is null. Should be not happened');
|
||||
}
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
dismissFlushBar(_authBar);
|
||||
dismissFlushBar(_progressBar);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (route != null) {
|
||||
Navigator.of(_key.currentContext!).pushReplacementNamed(route);
|
||||
} else {
|
||||
Navigator.of(_key.currentContext!).pop();
|
||||
}
|
||||
});
|
||||
});
|
||||
/// not the best scenario, but WidgetsBinding is not behaving correctly on Android
|
||||
await Future<void>.delayed(Duration(milliseconds: 50));
|
||||
await _authBar?.dismiss();
|
||||
await Future<void>.delayed(Duration(milliseconds: 50));
|
||||
await _progressBar?.dismiss();
|
||||
await Future<void>.delayed(Duration(milliseconds: 50));
|
||||
if (route != null) {
|
||||
Navigator.of(_key.currentContext!).pushReplacementNamed(route, arguments: arguments);
|
||||
} else {
|
||||
Navigator.of(_key.currentContext!).pop();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -156,13 +156,13 @@ abstract class SettingsViewModelBase with Store {
|
|||
handler: (BuildContext context) {
|
||||
Navigator.of(context).pushNamed(Routes.auth, arguments:
|
||||
(bool isAuthenticatedSuccessfully, AuthPageState auth) {
|
||||
auth.close();
|
||||
if (isAuthenticatedSuccessfully) {
|
||||
Navigator.of(context).pushNamed(Routes.setupPin, arguments:
|
||||
(PinCodeState<PinCodeWidget> setupPinContext, String _) {
|
||||
auth.close(
|
||||
route: isAuthenticatedSuccessfully ? Routes.setupPin : null,
|
||||
arguments: (PinCodeState<PinCodeWidget> setupPinContext,
|
||||
String _) {
|
||||
setupPinContext.close();
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}),
|
||||
PickerListItem(
|
||||
|
|
Loading…
Reference in a new issue