When the current chat has no model use the first index.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
Adam Treat 2024-03-11 14:00:33 -04:00
parent 0daf37ab8a
commit e2f64f89c9

View File

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