mirror of
https://github.com/xuquan-nikkkki/FolderFile-Splitter-Plugin.git
synced 2026-07-22 12:00:27 +00:00
fix: avoid detach leaves in onunload
This commit is contained in:
parent
482e94f953
commit
f4d732fa0e
1 changed files with 0 additions and 14 deletions
14
src/main.ts
14
src/main.ts
|
|
@ -90,7 +90,6 @@ export default class FolderFileSplitterPlugin extends Plugin {
|
|||
};
|
||||
|
||||
onunload() {
|
||||
this.detachFileTreeLeafs();
|
||||
this.app.vault.off("create", this.onCreate);
|
||||
this.app.vault.off("modify", this.onModify);
|
||||
this.app.vault.off("delete", this.onDelete);
|
||||
|
|
@ -119,17 +118,4 @@ export default class FolderFileSplitterPlugin extends Plugin {
|
|||
async saveSettings() {
|
||||
await this.saveData(this.settings);
|
||||
}
|
||||
|
||||
detachFileTreeLeafs = () => {
|
||||
const leafs = this.app.workspace.getLeavesOfType(this.VIEW_TYPE);
|
||||
for (const leaf of leafs) {
|
||||
(leaf.view as FileTreeView).destroy();
|
||||
leaf.detach();
|
||||
}
|
||||
};
|
||||
|
||||
refreshTreeLeafs = (showAfterAttach: boolean) => {
|
||||
this.detachFileTreeLeafs();
|
||||
this.openFileTreeLeaf(showAfterAttach);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue