Skip to content

Commit

Permalink
When the current chat has no model use the first index.
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Treat <treat.adam@gmail.com>
  • Loading branch information
manyoso committed Mar 11, 2024
1 parent 0daf37a commit e2f64f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gpt4all-chat/qml/ModelSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ MySettingsTab {
model: ModelList.installedModels
valueRole: "id"
textRole: "name"
currentIndex: comboBox.indexOfValue(ChatListModel.currentChat.modelInfo.id)
currentIndex: {
var i = comboBox.indexOfValue(ChatListModel.currentChat.modelInfo.id);
if (i >= 0)
return i;
return 0;
}
contentItem: Text {
leftPadding: 10
rightPadding: 20
Expand Down

0 comments on commit e2f64f8

Please sign in to comment.