Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

Fix. Avoid invalid verification code attempts. (#6925)

fufesou9e3633f1e4f6
diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart
index 5fe3bdefb..58db1047c 100644
--- a/flutter/lib/common/widgets/dialog.dart
+++ b/flutter/lib/common/widgets/dialog.dart
@@ -597,6 +597,7 @@ class _DialogVerificationCodeField extends State<DialogVerificationCodeField> {
Timer? _timer;
Timer? _timerReRequestFocus;
SimpleWrapper<String?> errorText = SimpleWrapper(null);
+ String _preText = '';
@override
void initState() {
@@ -607,7 +608,10 @@ class _DialogVerificationCodeField extends State<DialogVerificationCodeField> {
if (widget.onChanged != null) {
widget.controller.addListener(() {
+ final text = widget.controller.text.trim();
+ if (text == _preText) return;
widget.onChanged!(setState, errorText);
+ _preText = text;
});
}
}