deadlock cleanup

This commit is contained in:
Christien Rioux 2025-03-21 11:33:58 -04:00
parent 23867a1784
commit 2141dbff21
40 changed files with 254 additions and 253 deletions

View file

@ -61,6 +61,13 @@ class _EditAccountPageState extends WindowSetupState<EditAccountPage> {
);
Future<void> _onRemoveAccount() async {
// dismiss the keyboard by unfocusing the textfield
FocusScope.of(context).unfocus();
await asyncSleep(const Duration(milliseconds: 250));
if (!mounted) {
return;
}
final confirmed = await StyledDialog.show<bool>(
context: context,
title: translate('edit_account_page.remove_account_confirm'),
@ -87,10 +94,7 @@ class _EditAccountPageState extends WindowSetupState<EditAccountPage> {
]))
]).paddingAll(24)
]));
if (confirmed != null && confirmed && mounted) {
// dismiss the keyboard by unfocusing the textfield
FocusScope.of(context).unfocus();
if (confirmed != null && confirmed) {
try {
setState(() {
_isInAsyncCall = true;
@ -125,6 +129,13 @@ class _EditAccountPageState extends WindowSetupState<EditAccountPage> {
}
Future<void> _onDestroyAccount() async {
// dismiss the keyboard by unfocusing the textfield
FocusScope.of(context).unfocus();
await asyncSleep(const Duration(milliseconds: 250));
if (!mounted) {
return;
}
final confirmed = await StyledDialog.show<bool>(
context: context,
title: translate('edit_account_page.destroy_account_confirm'),
@ -154,10 +165,7 @@ class _EditAccountPageState extends WindowSetupState<EditAccountPage> {
]))
]).paddingAll(24)
]));
if (confirmed != null && confirmed && mounted) {
// dismiss the keyboard by unfocusing the textfield
FocusScope.of(context).unfocus();
if (confirmed != null && confirmed) {
try {
setState(() {
_isInAsyncCall = true;