fixed selected model

This commit is contained in:
yoannchb-pro
2024-03-18 21:57:57 -04:00
parent 56c2332628
commit c251819521
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -20,7 +20,7 @@ modelInput.addEventListener('input', checkCanIncludeImages);
/** /**
* Get the list of chatgpt versions * Get the list of chatgpt versions
*/ */
function getLastChatGPTVersion() { function getLastChatGPTVersion(selectedModel) {
const apiKeySelector = document.querySelector('#apiKey'); const apiKeySelector = document.querySelector('#apiKey');
const selectModel = document.querySelector('#model'); const selectModel = document.querySelector('#model');
@@ -49,6 +49,7 @@ function getLastChatGPTVersion() {
const opt = document.createElement('option'); const opt = document.createElement('option');
opt.value = model.id; opt.value = model.id;
opt.textContent = model.id; opt.textContent = model.id;
opt.selected = selectedModel && model.id === selectedModel;
selectModel.appendChild(opt); selectModel.appendChild(opt);
} }
+1 -1
View File
@@ -84,6 +84,6 @@ chrome.storage.sync.get(['moodleGPT']).then(function (storage) {
} }
handleModeChange(); handleModeChange();
getLastChatGPTVersion(); getLastChatGPTVersion(config?.model);
checkCanIncludeImages(); checkCanIncludeImages();
}); });