Skip to content

Commit

Permalink
perf: 调整打开 siyuan://plugins 链接事件的名称 | Adjust the name of the event …
Browse files Browse the repository at this point in the history
…to open the `siyuan://plugins` link.

REF: siyuan-note/siyuan#8927
  • Loading branch information
Zuoqiu-Yingyi committed Aug 14, 2023
1 parent 834800e commit 0a1fc92
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { EditorWindow } from "./editor/window";
import { HandlerType, type IFacadeOptions } from "./facades/facade";

/* 类型 */
import type { IClickBlockIconEvent, IClickEditorContentEvent, IOpenMenuLinkEvent, IOpenSiyuanUrlPluginsEvent } from "@workspace/types/siyuan/events";
import type { IClickBlockIconEvent, IClickEditorContentEvent, IOpenMenuLinkEvent, IOpenSiyuanUrlPluginEvent } from "@workspace/types/siyuan/events";
import type { BlockID } from "@workspace/types/siyuan";

import type {
Expand Down Expand Up @@ -290,7 +290,7 @@ export default class MonacoEditorPlugin extends siyuan.Plugin {
this.eventBus.on("open-menu-link", this.linkMenuEventListener);

/* 思源 URL */
this.eventBus.on("open-siyuan-url-plugins", this.openSiyuanUrlEventListener);
this.eventBus.on("open-siyuan-url-plugin", this.openSiyuanUrlEventListener);

// /* 快捷键/命令 */
// this.addCommand({
Expand Down Expand Up @@ -332,7 +332,7 @@ export default class MonacoEditorPlugin extends siyuan.Plugin {
this.eventBus.off("click-editortitleicon", this.blockMenuEventListener);
// this.eventBus.off("open-menu-blockref", this.blockRefMenuEventListener);
this.eventBus.off("open-menu-link", this.linkMenuEventListener);
this.eventBus.off("open-siyuan-url-plugins", this.openSiyuanUrlEventListener);
this.eventBus.off("open-siyuan-url-plugin", this.openSiyuanUrlEventListener);
}

openSetting(): void {
Expand Down Expand Up @@ -907,7 +907,7 @@ export default class MonacoEditorPlugin extends siyuan.Plugin {
}

/* 思源 URL 打开事件监听器 */
protected readonly openSiyuanUrlEventListener = async (e: IOpenSiyuanUrlPluginsEvent) => {
protected readonly openSiyuanUrlEventListener = async (e: IOpenSiyuanUrlPluginEvent) => {
// this.logger.debug(e);
const url = new URL(e.detail.url);
if (url.pathname.startsWith(`//plugins/${this.name}/workspace/`)) {
Expand Down

0 comments on commit 0a1fc92

Please sign in to comment.