Adjusted path tweak (#213)

This commit is contained in:
Graham Steffaniak 2024-09-17 12:15:29 -05:00 committed by GitHub
parent 2ec0c457cf
commit b4b92bf852
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -13,7 +13,7 @@ func (si *Index) UpdateFileMetadata(adjustedPath string, info FileInfo) bool {
si.mu.Lock()
defer si.mu.Unlock()
dir, exists := si.Directories[adjustedPath]
if !exists {
if !exists || exists && dir.Metadata == nil {
// Initialize the Metadata map if it is nil
if dir.Metadata == nil {
dir.Metadata = make(map[string]FileInfo)

View File

@ -286,14 +286,14 @@ export default {
window.addEventListener("keydown", this.keyEvent);
window.addEventListener("scroll", this.scrollEvent);
window.addEventListener("resize", this.windowsResize);
this.$el.addEventListener("click", this.clickClear);
this.$el.addEventListener("contextmenu", this.openContext);
if (!state.user.perm?.create) return;
this.$el.addEventListener("dragover", this.preventDefault);
this.$el.addEventListener("dragenter", this.dragEnter);
this.$el.addEventListener("dragleave", this.dragLeave);
this.$el.addEventListener("drop", this.drop);
this.$el.addEventListener("contextmenu", this.openContext);
this.$el.addEventListener("click", this.clickClear);
},
beforeUnmount() {
// Remove event listeners before destroying this page.
@ -442,6 +442,9 @@ export default {
this.alphanumericKeyPress(key); // Call the alphanumeric key press function
return;
}
if (noModifierKeys && getters.currentPromptName() != null) {
return
}
// Handle the space bar key
if (key === " ") {
event.preventDefault();