diff --git a/src/js/constants.js b/src/js/constants.js index 3c2ec999..b65d5e43 100644 --- a/src/js/constants.js +++ b/src/js/constants.js @@ -1437,6 +1437,9 @@ class Menu { if (constants.emailAuthKey && constants.clientToken) { console.log('email auth key and client token found'); + for (let model in constants.LLMModels) { + document.getElementById(`LLM_model_${model}`).checked = true; + } this.DisableLLMAPIKeys(); } else { for (let model in constants.LLMModels) { @@ -1894,6 +1897,11 @@ class ChatLLM { document.getElementById('delete_email_key').style = 'display: none'; constants.clientToken = ''; document.getElementById('verify').classList.remove('hidden'); + for (let model in constants.LLMModels) { + document + .getElementById(`${model}_auth_key_container`) + .classList.remove('hidden'); + } }, ]); constants.events.push([ diff --git a/src/js/init.js b/src/js/init.js index 6df71ea8..47a247b3 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -224,13 +224,13 @@ function DestroyMaidr() { for (let i = 0; i < constants.events.length; i++) { if (Array.isArray(constants.events[i][0])) { for (let j = 0; j < constants.events[i][0].length; j++) { - constants.events[i][0][j].removeEventListener( + constants.events[i][0][j]?.removeEventListener( constants.events[i][1], constants.events[i][2] ); } } else { - constants.events[i][0].removeEventListener( + constants.events[i][0]?.removeEventListener( constants.events[i][1], constants.events[i][2] );