Skip to content

Commit

Permalink
fix: enhance LLM model visibility and improve event listener cleanup (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dakshpokar authored Nov 22, 2024
1 parent dffe2a6 commit 3ff2da0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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([
Expand Down
4 changes: 2 additions & 2 deletions src/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
);
Expand Down

0 comments on commit 3ff2da0

Please sign in to comment.