Skip to content

Commit

Permalink
fix: check whether FileExplorerView.dom is defined before use
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnFreyer committed Jan 17, 2024
1 parent 2a0af99 commit 94ff36f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fe-handler/folder-focus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class FolderFocus extends FEHandler_Base {
this.fileExplorer.dom.infinityScroll.scrollIntoView(item);
});
}
this.fileExplorer.dom.navFileContainerEl.toggleClass(focusModeCls, !!item);
this.fileExplorer.dom?.navFileContainerEl?.toggleClass(focusModeCls, !!item);
}
toggleFocusFolder(folder: TFolder | null) {
const folderItem = folder
Expand Down
2 changes: 1 addition & 1 deletion src/fe-patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const PatchFileExplorer = (plugin: ALxFolderNote) => {
const self = this;
next.call(self);
self.folderNoteUtils = getFileExplorerHandlers(plugin, self);
AddLongPressEvt(plugin, self.dom.navFileContainerEl);
if (typeof self.dom?.navFileContainerEl !== "undefined") AddLongPressEvt(plugin, self.dom.navFileContainerEl);
self.containerEl.on(
"auxclick",
".nav-folder",
Expand Down

0 comments on commit 94ff36f

Please sign in to comment.