瀏覽代碼

fix(plugin): incorrect status for beforeunload hook

charlie 2 年之前
父節點
當前提交
8b406f68c7
共有 1 個文件被更改,包括 2 次插入2 次删除
  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),