fix: make.md plugin integration

This commit is contained in:
Sergey Kolesnik 2025-12-18 20:58:14 +03:00 committed by GitHub
parent 1d7a065b8a
commit f4dbd3e93c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,7 +44,17 @@ export function getFileExplorer(
plugin: FolderNotesPlugin | FolderOverviewPlugin,
): FileExplorerWorkspaceLeaf {
// eslint-disable-next-line max-len
const leaf = plugin.app.workspace.getLeavesOfType('file-explorer')[0] as unknown as FileExplorerWorkspaceLeaf;
let leaf = plugin.app.workspace.getLeavesOfType('file-explorer')[0] as unknown as FileExplorerWorkspaceLeaf;
/* make.md plugin integration */
if (leaf.containerEl.lastChild.dataset.type == 'mk-path-view') {
plugin.app.workspace.iterateAllLeaves((x) => {
if (x.tabHeaderEl.dataset.type == 'file-explorer') {
leaf = x;
}
});
}
return leaf;
}