skip layout-ready setup if already unloaded
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user