Fix Chat Completions status check on settings loading if another API is selected

This commit is contained in:
Cohee 2024-02-22 04:36:06 +02:00
parent 06c3ea7c51
commit ece3b2a7c1
1 changed files with 6 additions and 8 deletions

View File

@ -3739,9 +3739,11 @@ async function testApiConnection() {
}
function reconnectOpenAi() {
setOnlineStatus('no_connection');
resultCheckStatus();
$('#api_button_openai').trigger('click');
if (main_api == 'openai') {
setOnlineStatus('no_connection');
resultCheckStatus();
$('#api_button_openai').trigger('click');
}
}
function onProxyPasswordShowClick() {
@ -4202,11 +4204,7 @@ $(document).ready(async function () {
oai_settings.chat_completion_source = String($(this).find(':selected').val());
toggleChatCompletionForms();
saveSettingsDebounced();
if (main_api == 'openai') {
reconnectOpenAi();
}
reconnectOpenAi();
eventSource.emit(event_types.CHATCOMPLETION_SOURCE_CHANGED, oai_settings.chat_completion_source);
});