mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-09 14:42:23 -04:00
deadlock cleanup
This commit is contained in:
parent
23867a1784
commit
2141dbff21
40 changed files with 254 additions and 253 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue