fix(profile): prevent duplicate PIN dialog pops

This commit is contained in:
edde746
2026-05-12 05:49:38 +02:00
parent e5922f4870
commit 37b1a26cde
2 changed files with 69 additions and 2 deletions
+7 -2
View File
@@ -27,6 +27,7 @@ class _PinEntryDialogState extends State<PinEntryDialog> with SingleTickerProvid
late Animation<double> _shakeAnimation;
final _pinInputKey = GlobalKey<_TvPinInputState>();
final _cancelFocusNode = FocusNode(debugLabel: 'PinCancelButton');
bool _completed = false;
@override
void initState() {
@@ -56,11 +57,15 @@ class _PinEntryDialogState extends State<PinEntryDialog> with SingleTickerProvid
}
void _submit(String pin) {
Navigator.of(context).pop(pin);
if (_completed) return;
_completed = true;
Navigator.of(context).pop<String>(pin);
}
void _cancel() {
Navigator.of(context).pop(null);
if (_completed) return;
_completed = true;
Navigator.of(context).pop<String>();
}
void _focusPinInput() {