mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-07 09:52:49 +08:00
Fix. Avoid invalid verification code attempts. (#6925)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
06b3894249
commit
9e3633f1e4
@ -597,6 +597,7 @@ class _DialogVerificationCodeField extends State<DialogVerificationCodeField> {
|
|||||||
Timer? _timer;
|
Timer? _timer;
|
||||||
Timer? _timerReRequestFocus;
|
Timer? _timerReRequestFocus;
|
||||||
SimpleWrapper<String?> errorText = SimpleWrapper(null);
|
SimpleWrapper<String?> errorText = SimpleWrapper(null);
|
||||||
|
String _preText = '';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -607,7 +608,10 @@ class _DialogVerificationCodeField extends State<DialogVerificationCodeField> {
|
|||||||
|
|
||||||
if (widget.onChanged != null) {
|
if (widget.onChanged != null) {
|
||||||
widget.controller.addListener(() {
|
widget.controller.addListener(() {
|
||||||
|
final text = widget.controller.text.trim();
|
||||||
|
if (text == _preText) return;
|
||||||
widget.onChanged!(setState, errorText);
|
widget.onChanged!(setState, errorText);
|
||||||
|
_preText = text;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user