fixed include images button

This commit is contained in:
yoannchb-pro
2024-03-11 19:25:14 -04:00
parent c207abb1f6
commit 6e68ff470a
3 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -15,7 +15,6 @@ function checkCanIncludeImages() {
}
}
checkCanIncludeImages();
modelInput.addEventListener('input', checkCanIncludeImages);
/**
@@ -57,8 +56,11 @@ function getLastChatGPTVersion() {
}
});
const rep = await req.json();
rep.data.sort((a, b) => b.id.localeCompare(a.id)); // we sort the model to get the best chatgpt version
const model = rep.data.find(model => model.id.startsWith('gpt'));
modelInput.value = model.id;
checkCanIncludeImages();
} catch (err) {
console.error(err);
showMessage({ msg: 'Failed to fetch last ChatGPT version', error: true });
+1
View File
@@ -85,4 +85,5 @@ chrome.storage.sync.get(['moodleGPT']).then(function (storage) {
handleModeChange();
getLastChatGPTVersion();
checkCanIncludeImages();
});