Fixed not being able to select model

This commit is contained in:
JHubi1 2024-06-03 15:42:39 +02:00
parent 279f35f89b
commit 2735357852
No known key found for this signature in database
GPG Key ID: 7BF82570CBBBD050
1 changed files with 4 additions and 1 deletions

View File

@ -77,6 +77,7 @@ void setModel(BuildContext context, Function setState) {
messages = []; messages = [];
} }
model = (usedIndex >= 0) ? modelsReal[usedIndex] : null; model = (usedIndex >= 0) ? modelsReal[usedIndex] : null;
chatAllowed = !(model == null);
multimodal = (usedIndex >= 0) ? modal[usedIndex] : false; multimodal = (usedIndex >= 0) ? modal[usedIndex] : false;
if (model != null) { if (model != null) {
prefs?.setString("model", model!); prefs?.setString("model", model!);
@ -176,7 +177,9 @@ void setModel(BuildContext context, Function setState) {
.modelDialogAddSteps), .modelDialogAddSteps),
showCloseIcon: true)); showCloseIcon: true));
} }
if (!chatAllowed) return; if (!chatAllowed && model != null) {
return;
}
setLocalState(() { setLocalState(() {
usedIndex = selected ? index : -1; usedIndex = selected ? index : -1;
}); });