Skip to content

Commit

Permalink
🎨 fix #9033
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Aug 24, 2023
1 parent 5897386 commit 67082df
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/src/protyle/util/destroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ export const destroy = (protyle: IProtyle) => {
protyle.ws.send("closews", {});
}, 10240);
}
protyle.app.plugins.forEach(item => {
item.eventBus.emit("destroy-protyle", {
protyle,
});
});
};
6 changes: 6 additions & 0 deletions app/src/protyle/util/onGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ const setHTML = (options: {
}

if (options.action.includes(Constants.CB_GET_APPEND) || options.action.includes(Constants.CB_GET_BEFORE)) {
protyle.app.plugins.forEach(item => {
item.eventBus.emit("loaded-protyle-dynamic", {
protyle,
positon: options.action.includes(Constants.CB_GET_APPEND) ? "afterend" : "beforebegin"
});
});
return;
}
if (protyle.options.render.breadcrumb) {
Expand Down
3 changes: 2 additions & 1 deletion app/src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ type TEventBus = "ws-main" |
"open-menu-av" | "open-menu-content" | "open-menu-breadcrumbmore" |
"open-siyuan-url-plugin" | "open-siyuan-url-block" |
"input-search" |
"loaded-protyle"
"loaded-protyle" | "loaded-protyle-dynamic"|
"destroy-protyle"
type TAVCol =
"text"
| "date"
Expand Down

0 comments on commit 67082df

Please sign in to comment.