From 80abe032139cc2cbf8eea4b48932e8c79260b8da Mon Sep 17 00:00:00 2001 From: ras0q Date: Wed, 5 Jun 2024 16:44:18 +0900 Subject: [PATCH] :bug: fix typos --- src/main.ts | 12 +++++++----- styles.css | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main.ts b/src/main.ts index 45656cf..b6d0459 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,10 +4,12 @@ import { MarkdownView, Platform, Plugin, WorkspaceRoot } from "obsidian"; export default class GraphBannerPlugin extends Plugin { static graphBannerNodeClass = "graph-banner-content"; - onUnload: (() => void)[] = []; + unloadListeners: (() => void)[] = []; graphNode: Element | null = null; async onload() { + console.log("Loading GraphBannerPlugin"); + // NOTE: https://github.com/mgmeyers/obsidian-style-settings?tab=readme-ov-file#plugin-support this.app.workspace.trigger("parse-style-settings"); @@ -39,7 +41,7 @@ export default class GraphBannerPlugin extends Plugin { mainWindow.focus(); } - this.onUnload.push(() => { + this.unloadListeners.push(() => { graphWindow.closable && graphWindow.close(); }); }), @@ -108,14 +110,14 @@ export default class GraphBannerPlugin extends Plugin { ); } - async unload() { + async onunload() { console.log("Unloading GraphBannerPlugin"); this.graphNode?.removeClass(GraphBannerPlugin.graphBannerNodeClass); this.graphNode = null; - for (const handleUnload of this.onUnload) { - handleUnload(); + for (const unloadCallback of this.unloadListeners) { + unloadCallback(); } } diff --git a/styles.css b/styles.css index bd7caf7..d66c85a 100644 --- a/styles.css +++ b/styles.css @@ -1,8 +1,8 @@ /* https://github.com/mgmeyers/obsidian-style-settings */ /* @settings -name: Braph Banner -id: braph-banner +name: Graph Banner +id: graph-banner settings: - id: banner-height title: Banner Height