no more notifying the error about mising api key and model

This commit is contained in:
mic 2024-08-09 17:07:02 +02:00
parent 28664879ea
commit 7ec3a3ad0f

View file

@ -147,6 +147,7 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
return; return;
} }
if(prefs.connection_type === 'chatgpt_api'){
// check if the API is present, otherwise open the web interface // check if the API is present, otherwise open the web interface
if (prefs.chatgpt_api_key == '') { if (prefs.chatgpt_api_key == '') {
showNotification(browser.i18n.getMessage('error'),browser.i18n.getMessage('chatgpt_empty_apikey')); showNotification(browser.i18n.getMessage('error'),browser.i18n.getMessage('chatgpt_empty_apikey'));
@ -155,6 +156,7 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
if (prefs.chatgpt_model == '') { if (prefs.chatgpt_model == '') {
showNotification(browser.i18n.getMessage('error'),browser.i18n.getMessage('chatgpt_empty_model')); showNotification(browser.i18n.getMessage('error'),browser.i18n.getMessage('chatgpt_empty_model'));
prefs.connection_type = 'chatgpt_web'; prefs.connection_type = 'chatgpt_web';
}
} }
switch(prefs.connection_type){ switch(prefs.connection_type){