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;
|
||||
}
|
||||
|
||||
// check if the API is present, otherwise open the web interface
|
||||
if (prefs.chatgpt_api_key == '') {
|
||||
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'));
|
||||
prefs.connection_type = 'chatgpt_web';
|
||||
if(prefs.connection_type === 'chatgpt_api'){
|
||||
// check if the API is present, otherwise open the web interface
|
||||
if (prefs.chatgpt_api_key == '') {
|
||||
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'));
|
||||
prefs.connection_type = 'chatgpt_web';
|
||||
}
|
||||
}
|
||||
|
||||
switch(prefs.connection_type){
|
||||
|
|
|
|||
Loading…
Reference in a new issue