diff --git a/TODO.md b/TODO.md index 855edfc..815cb61 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,6 @@ # TODO - Historic for questions (implemented but need testing) -- Fixe include images button display - Better prompt (Fixe put in order question, Fixe calculation question) - Better webstore assets - Do some tests diff --git a/extension/popup/js/gptVersion.js b/extension/popup/js/gptVersion.js index 00b1488..917c55e 100644 --- a/extension/popup/js/gptVersion.js +++ b/extension/popup/js/gptVersion.js @@ -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 }); diff --git a/extension/popup/js/index.js b/extension/popup/js/index.js index f293fbf..d7c2515 100644 --- a/extension/popup/js/index.js +++ b/extension/popup/js/index.js @@ -85,4 +85,5 @@ chrome.storage.sync.get(['moodleGPT']).then(function (storage) { handleModeChange(); getLastChatGPTVersion(); + checkCanIncludeImages(); });