diff --git a/main.js b/main.js index 2d4d572..e4e288b 100644 --- a/main.js +++ b/main.js @@ -9,6 +9,8 @@ module.exports = class RibbonClasp extends Plugin { this.debouncedEnforce = debounce(() => this.enforceOrder(), 200, true); this.app.workspace.onLayoutReady(() => { + // not tied to our lifecycle; still fires if we were disabled during boot + if (this.unloaded) return; this.patchRibbon(); this.enforceOrder(); this.observeRibbon(); @@ -16,6 +18,7 @@ module.exports = class RibbonClasp extends Plugin { } onunload() { + this.unloaded = true; this.observer?.disconnect(); // disconnect doesn't stop an already-scheduled call this.debouncedEnforce?.cancel();