mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-22 15:19:11 +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 =>
|
bool get fieldsMatch =>
|
||||||
passwordController.text == passwordRepeatController.text;
|
passwordController.text == passwordRepeatController.text;
|
||||||
|
|
||||||
|
bool _nextLock = false;
|
||||||
|
|
||||||
void onNextPressed() async {
|
void onNextPressed() async {
|
||||||
|
if (_nextLock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_nextLock = true;
|
||||||
|
|
||||||
final String passphrase = passwordController.text;
|
final String passphrase = passwordController.text;
|
||||||
final String repeatPassphrase = passwordRepeatController.text;
|
final String repeatPassphrase = passwordRepeatController.text;
|
||||||
|
|
||||||
|
@ -75,6 +82,7 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
||||||
message: "A password is required",
|
message: "A password is required",
|
||||||
context: context,
|
context: context,
|
||||||
));
|
));
|
||||||
|
_nextLock = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (passphrase != repeatPassphrase) {
|
if (passphrase != repeatPassphrase) {
|
||||||
|
@ -83,6 +91,7 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
||||||
message: "Password does not match",
|
message: "Password does not match",
|
||||||
context: context,
|
context: context,
|
||||||
));
|
));
|
||||||
|
_nextLock = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,6 +115,7 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
||||||
message: "Error: $e",
|
message: "Error: $e",
|
||||||
context: context,
|
context: context,
|
||||||
));
|
));
|
||||||
|
_nextLock = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +142,7 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
||||||
context: context,
|
context: context,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
_nextLock = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -79,11 +79,18 @@ class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _loginLock = false;
|
||||||
Future<void> login() async {
|
Future<void> login() async {
|
||||||
|
if (_loginLock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loginLock = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
unawaited(
|
unawaited(
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
barrierDismissible: false,
|
||||||
builder: (context) => const Column(
|
builder: (context) => const Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
@ -138,6 +145,8 @@ class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
|
||||||
context: context,
|
context: context,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
_loginLock = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue