fix: Getting logged out on dialog dismissed

closes https://github.com/krille-chan/fluffychat/issues/2777
This commit is contained in:
Christian Kußowski 2026-03-28 15:06:38 +01:00
commit dbf0894b53
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -65,18 +65,16 @@ class SettingsController extends State<Settings> {
Future<void> logoutAction() async {
final l10n = L10n.of(context);
final matrix = Matrix.of(context);
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: l10n.areYouSureYouWantToLogout,
message: l10n.noBackupWarning,
isDestructive: cryptoIdentityConnected == false,
okLabel: l10n.logout,
cancelLabel: l10n.cancel,
) ==
OkCancelResult.cancel) {
return;
}
final consent = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: l10n.areYouSureYouWantToLogout,
message: l10n.noBackupWarning,
isDestructive: cryptoIdentityConnected == false,
okLabel: l10n.logout,
cancelLabel: l10n.cancel,
);
if (consent != OkCancelResult.ok) return;
if (!mounted) return;
await showFutureLoadingDialog(
context: context,