fix(profiles): guard pin dialog route pops

This commit is contained in:
edde746
2026-06-13 13:25:41 +02:00
parent f3f962a7c9
commit ebd850b0d5
2 changed files with 66 additions and 2 deletions
+4 -2
View File
@@ -57,14 +57,16 @@ class _PinEntryDialogState extends State<PinEntryDialog> with SingleTickerProvid
super.dispose();
}
bool get _isCurrentRoute => mounted && ModalRoute.of(context)?.isCurrent == true;
void _submit(String pin) {
if (_completed) return;
if (_completed || !_isCurrentRoute) return;
_completed = true;
Navigator.of(context).pop<String>(pin);
}
void _cancel() {
if (_completed) return;
if (_completed || !_isCurrentRoute) return;
_completed = true;
Navigator.of(context).pop<String>();
}