mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-10 20:54:33 +00:00
critical desktop password related button/function locks
This commit is contained in:
parent
ce0b871284
commit
86be1444ea
2 changed files with 20 additions and 0 deletions
|
@ -65,7 +65,14 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
|||
bool get fieldsMatch =>
|
||||
passwordController.text == passwordRepeatController.text;
|
||||
|
||||
bool _nextLock = false;
|
||||
|
||||
void onNextPressed() async {
|
||||
if (_nextLock) {
|
||||
return;
|
||||
}
|
||||
_nextLock = true;
|
||||
|
||||
final String passphrase = passwordController.text;
|
||||
final String repeatPassphrase = passwordRepeatController.text;
|
||||
|
||||
|
@ -75,6 +82,7 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
|||
message: "A password is required",
|
||||
context: context,
|
||||
));
|
||||
_nextLock = false;
|
||||
return;
|
||||
}
|
||||
if (passphrase != repeatPassphrase) {
|
||||
|
@ -83,6 +91,7 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
|||
message: "Password does not match",
|
||||
context: context,
|
||||
));
|
||||
_nextLock = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -106,6 +115,7 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
|||
message: "Error: $e",
|
||||
context: context,
|
||||
));
|
||||
_nextLock = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -132,6 +142,7 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
|||
context: context,
|
||||
));
|
||||
}
|
||||
_nextLock = false;
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -79,11 +79,18 @@ class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
|
|||
}
|
||||
}
|
||||
|
||||
bool _loginLock = false;
|
||||
Future<void> login() async {
|
||||
if (_loginLock) {
|
||||
return;
|
||||
}
|
||||
_loginLock = true;
|
||||
|
||||
try {
|
||||
unawaited(
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
@ -138,6 +145,8 @@ class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
|
|||
context: context,
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
_loginLock = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue