mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 11:45:10 +00:00
chore: Display warning when logout without backup
This commit is contained in:
parent
a0baa747ca
commit
c089262ea9
4 changed files with 14 additions and 8 deletions
|
@ -2516,5 +2516,6 @@
|
|||
"deviceKeys": "Device keys:",
|
||||
"letsStart": "Let's start",
|
||||
"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(
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.all(16),
|
||||
|
|
|
@ -58,11 +58,14 @@ class SettingsController extends State<Settings> {
|
|||
}
|
||||
|
||||
void logoutAction() async {
|
||||
final noBackup = showChatBackupBanner == true;
|
||||
if (await showOkCancelAlertDialog(
|
||||
useRootNavigator: false,
|
||||
context: context,
|
||||
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,
|
||||
) ==
|
||||
OkCancelResult.cancel) {
|
||||
|
|
|
@ -31,12 +31,9 @@ class SettingsChatView extends StatelessWidget {
|
|||
title: Text(L10n.of(context)!.emoteSettings),
|
||||
onTap: () => VRouter.of(context).to('emotes'),
|
||||
trailing: const Icon(Icons.chevron_right_outlined),
|
||||
leading: const Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Icon(Icons.insert_emoticon_outlined),
|
||||
),
|
||||
leading: const Icon(Icons.emoji_emotions_outlined),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(),
|
||||
SettingsSwitchListTile.adaptive(
|
||||
title: L10n.of(context)!.renderRichContent,
|
||||
onChanged: (b) => AppConfig.renderHtml = b,
|
||||
|
@ -68,7 +65,7 @@ class SettingsChatView extends StatelessWidget {
|
|||
storeKey: SettingKeys.autoplayImages,
|
||||
defaultValue: AppConfig.autoplayImages,
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(),
|
||||
SettingsSwitchListTile.adaptive(
|
||||
title: L10n.of(context)!.sendOnEnter,
|
||||
onChanged: (b) => AppConfig.sendOnEnter = b,
|
||||
|
|
Loading…
Reference in a new issue