mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 14:59:29 +01:00
chore: Display warning when logout without backup
This commit is contained in:
parent
c670dc2700
commit
2ccc30879b
@ -2516,5 +2516,6 @@
|
|||||||
"deviceKeys": "Device keys:",
|
"deviceKeys": "Device keys:",
|
||||||
"letsStart": "Let's start",
|
"letsStart": "Let's start",
|
||||||
"enterInviteLinkOrMatrixId": "Enter invite link or Matrix ID...",
|
"enterInviteLinkOrMatrixId": "Enter invite link or Matrix ID...",
|
||||||
"reopenChat": "Reopen chat"
|
"reopenChat": "Reopen chat",
|
||||||
|
"noBackupWarning": "Warning! Without enabling chat backup, you will lose access to your encrypted messages. It is highly recommended to enable the chat backup first before logging out."
|
||||||
}
|
}
|
@ -94,6 +94,11 @@ abstract class FluffyThemes {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
dialogTheme: DialogTheme(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||||
|
),
|
||||||
|
),
|
||||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
|
@ -58,11 +58,14 @@ class SettingsController extends State<Settings> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void logoutAction() async {
|
void logoutAction() async {
|
||||||
|
final noBackup = showChatBackupBanner == true;
|
||||||
if (await showOkCancelAlertDialog(
|
if (await showOkCancelAlertDialog(
|
||||||
useRootNavigator: false,
|
useRootNavigator: false,
|
||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context)!.areYouSureYouWantToLogout,
|
title: L10n.of(context)!.areYouSureYouWantToLogout,
|
||||||
okLabel: L10n.of(context)!.yes,
|
message: L10n.of(context)!.noBackupWarning,
|
||||||
|
isDestructiveAction: noBackup,
|
||||||
|
okLabel: L10n.of(context)!.logout,
|
||||||
cancelLabel: L10n.of(context)!.cancel,
|
cancelLabel: L10n.of(context)!.cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) {
|
OkCancelResult.cancel) {
|
||||||
|
@ -31,12 +31,9 @@ class SettingsChatView extends StatelessWidget {
|
|||||||
title: Text(L10n.of(context)!.emoteSettings),
|
title: Text(L10n.of(context)!.emoteSettings),
|
||||||
onTap: () => VRouter.of(context).to('emotes'),
|
onTap: () => VRouter.of(context).to('emotes'),
|
||||||
trailing: const Icon(Icons.chevron_right_outlined),
|
trailing: const Icon(Icons.chevron_right_outlined),
|
||||||
leading: const Padding(
|
leading: const Icon(Icons.emoji_emotions_outlined),
|
||||||
padding: EdgeInsets.all(16.0),
|
|
||||||
child: Icon(Icons.insert_emoticon_outlined),
|
|
||||||
),
|
),
|
||||||
),
|
const Divider(),
|
||||||
const Divider(height: 1),
|
|
||||||
SettingsSwitchListTile.adaptive(
|
SettingsSwitchListTile.adaptive(
|
||||||
title: L10n.of(context)!.renderRichContent,
|
title: L10n.of(context)!.renderRichContent,
|
||||||
onChanged: (b) => AppConfig.renderHtml = b,
|
onChanged: (b) => AppConfig.renderHtml = b,
|
||||||
@ -68,7 +65,7 @@ class SettingsChatView extends StatelessWidget {
|
|||||||
storeKey: SettingKeys.autoplayImages,
|
storeKey: SettingKeys.autoplayImages,
|
||||||
defaultValue: AppConfig.autoplayImages,
|
defaultValue: AppConfig.autoplayImages,
|
||||||
),
|
),
|
||||||
const Divider(height: 1),
|
const Divider(),
|
||||||
SettingsSwitchListTile.adaptive(
|
SettingsSwitchListTile.adaptive(
|
||||||
title: L10n.of(context)!.sendOnEnter,
|
title: L10n.of(context)!.sendOnEnter,
|
||||||
onChanged: (b) => AppConfig.sendOnEnter = b,
|
onChanged: (b) => AppConfig.sendOnEnter = b,
|
||||||
|
Loading…
Reference in New Issue
Block a user