Browse Source

fix(plugin): incorrect status for beforeunload hook

charlie 2 years ago
parent
commit
8b406f68c7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      libs/src/LSPlugin.core.ts

+ 2 - 2
libs/src/LSPlugin.core.ts

@@ -911,11 +911,11 @@ class PluginLocal extends EventEmitter<'loaded'
     }
 
     try {
-      this._status = PluginLocalLoadStatus.UNLOADING
-
       const eventBeforeUnload = { unregister }
 
       if (this.loaded) {
+        this._status = PluginLocalLoadStatus.UNLOADING
+
         try {
           await this._caller?.callUserModel(
             AWAIT_LSPMSGFn(LSPMSG_BEFORE_UNLOAD),