google_gemini_api: fixed a bug in checking empty apikey and model prefs

This commit is contained in:
Mic 2025-01-16 23:01:00 +01:00
parent 80fcf0e99a
commit a9e55c71b5

View file

@ -417,11 +417,11 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
if(mailMessage) mailMessageId5 = mailMessage.id;
// check if the config is present, or give a message error
if (prefs.chatgpt_api_key == '') {
if (prefs.google_gemini_api_key == '') {
browser.tabs.sendMessage(createdTab.id, { command: "api_error", error: browser.i18n.getMessage('google_gemini_empty_apikey')});
return;
}
if (prefs.chatgpt_model == '') {
if (prefs.google_gemini_model == '') {
browser.tabs.sendMessage(createdTab.id, { command: "api_error", error: browser.i18n.getMessage('google_gemini_empty_model')});
return;
}