no more notifying the error about mising api key and model
This commit is contained in:
parent
28664879ea
commit
7ec3a3ad0f
1 changed files with 10 additions and 8 deletions
|
|
@ -147,14 +147,16 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the API is present, otherwise open the web interface
|
if(prefs.connection_type === 'chatgpt_api'){
|
||||||
if (prefs.chatgpt_api_key == '') {
|
// check if the API is present, otherwise open the web interface
|
||||||
showNotification(browser.i18n.getMessage('error'),browser.i18n.getMessage('chatgpt_empty_apikey'));
|
if (prefs.chatgpt_api_key == '') {
|
||||||
prefs.connection_type = 'chatgpt_web';
|
showNotification(browser.i18n.getMessage('error'),browser.i18n.getMessage('chatgpt_empty_apikey'));
|
||||||
}
|
prefs.connection_type = 'chatgpt_web';
|
||||||
if (prefs.chatgpt_model == '') {
|
}
|
||||||
showNotification(browser.i18n.getMessage('error'),browser.i18n.getMessage('chatgpt_empty_model'));
|
if (prefs.chatgpt_model == '') {
|
||||||
prefs.connection_type = 'chatgpt_web';
|
showNotification(browser.i18n.getMessage('error'),browser.i18n.getMessage('chatgpt_empty_model'));
|
||||||
|
prefs.connection_type = 'chatgpt_web';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(prefs.connection_type){
|
switch(prefs.connection_type){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue