skip layout-ready setup if already unloaded

This commit is contained in:
2026-08-02 00:36:38 +06:00
parent 697966deff
commit 14cfe46c26
+3
View File
@@ -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();