Fixed title generation, added info message for imported chats

This commit is contained in:
JHubi1 2024-08-20 20:23:57 +02:00
parent e8820162b0
commit e7a1d93196
No known key found for this signature in database
GPG Key ID: 7BF82570CBBBD050
4 changed files with 24 additions and 13 deletions

View File

@ -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",

View File

@ -88,6 +88,12 @@ class _ScreenSettingsExportState extends State<ScreenSettingsExport> {
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(

View File

@ -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<String> prompt(BuildContext context,
uuid) {
try {
var title = await getTitleAi(
await getHistory());
jsonDecode(jsonDecode(
(prefs!.getStringList(
"chats") ??
[])[
i])["messages"]));
controller.text = title;
setLocalState(() {
loading = false;

View File

@ -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"
]
}