diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index ed39e7f..72e60d1 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -544,6 +544,11 @@ "description": "Text displayed as description for export chats button", "context": "Visible in the settings view" }, + "settingsExportChatsSuccess": "Chats exported successfully", + "@settingsExportChatsSuccess": { + "description": "Text displayed when chats are exported successfully", + "context": "Visible in the settings view" + }, "settingsImportChats": "Import chats", "@settingsImportChats": { "description": "Text displayed as description for import chats button", diff --git a/lib/settings/export.dart b/lib/settings/export.dart index 2a73f55..c5c344d 100644 --- a/lib/settings/export.dart +++ b/lib/settings/export.dart @@ -88,6 +88,12 @@ class _ScreenSettingsExportState extends State { File(path).writeAsString(content); } } + // ignore: use_build_context_synchronously + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + // ignore: use_build_context_synchronously + content: Text(AppLocalizations.of(context)! + .settingsExportChatsSuccess), + showCloseIcon: true)); }), allowMultipleChats ? button( diff --git a/lib/worker/setter.dart b/lib/worker/setter.dart index 3427b00..ea16aad 100644 --- a/lib/worker/setter.dart +++ b/lib/worker/setter.dart @@ -216,12 +216,8 @@ void setModel(BuildContext context, Function setState) { ? ((MediaQuery.of(context) .platformBrightness == Brightness.light) - ? themeLight() - .colorScheme - .secondary - : themeDark() - .colorScheme - .secondary) + ? themeLight().colorScheme.secondary + : themeDark().colorScheme.secondary) : null, labelStyle: (usedIndex == index && !(prefs?.getBool( @@ -245,12 +241,8 @@ void setModel(BuildContext context, Function setState) { : (MediaQuery.of(context) .platformBrightness == Brightness.light) - ?themeLight() - .colorScheme - .primary - : themeDark() - .colorScheme - .primary, + ? themeLight().colorScheme.primary + : themeDark().colorScheme.primary, onSelected: (bool selected) { selectionHaptic(); if (addIndex == index) { @@ -539,7 +531,11 @@ Future prompt(BuildContext context, uuid) { try { var title = await getTitleAi( - await getHistory()); + jsonDecode(jsonDecode( + (prefs!.getStringList( + "chats") ?? + [])[ + i])["messages"])); controller.text = title; setLocalState(() { loading = false; diff --git a/untranslated_messages.json b/untranslated_messages.json index 685c551..c098fe4 100644 --- a/untranslated_messages.json +++ b/untranslated_messages.json @@ -17,6 +17,7 @@ "settingsVoiceTtsNotSupported", "settingsVoiceTtsNotSupportedDescription", "settingsVoiceNotEnabled", + "settingsExportChatsSuccess", "settingsLicenses" ], @@ -38,6 +39,7 @@ "settingsVoiceTtsNotSupported", "settingsVoiceTtsNotSupportedDescription", "settingsVoiceNotEnabled", + "settingsExportChatsSuccess", "settingsLicenses" ], @@ -59,6 +61,7 @@ "settingsVoiceTtsNotSupported", "settingsVoiceTtsNotSupportedDescription", "settingsVoiceNotEnabled", + "settingsExportChatsSuccess", "settingsLicenses" ], @@ -80,6 +83,7 @@ "settingsVoiceTtsNotSupported", "settingsVoiceTtsNotSupportedDescription", "settingsVoiceNotEnabled", + "settingsExportChatsSuccess", "settingsLicenses" ] }