Skip to content

Commit

Permalink
Fix reset button
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Apr 14, 2024
1 parent 47b4db1 commit 5e231a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions public/chat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ <h3 class="text-center">Welcome to BioImage.IO Chatbot</h3>
let mountedFolder;
let extensions = [];
let envPrompt = "";
const registeredExtensions = []
let registeredExtensions = []
function fileSelected() {
var input = document.getElementById('fileUpload');
var label = document.getElementById('paperclipIcon');
Expand Down Expand Up @@ -784,9 +784,11 @@ <h3 class="text-center">Welcome to BioImage.IO Chatbot</h3>
}
}

// remove extension with the same id in extensions
extensions = extensions.filter(ext => ext.id !== extension.id)
extensions.push(extension);
// remove duplicates
extensions = extensions.filter((v, i, a) => a.findIndex(t => (t.id === v.id)) === i)
// remove extension with the same id in registeredExtensions (const variable)
registeredExtensions = registeredExtensions.filter(ext => ext.id !== extension.id)
registeredExtensions.push(extension);
updateDropdownOptions(extensions);
}
Expand Down

0 comments on commit 5e231a1

Please sign in to comment.