fixed selected model
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,6 @@ chrome.storage.sync.get(['moodleGPT']).then(function (storage) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleModeChange();
|
handleModeChange();
|
||||||
getLastChatGPTVersion();
|
getLastChatGPTVersion(config?.model);
|
||||||
checkCanIncludeImages();
|
checkCanIncludeImages();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user