浏览代码

fix(plugin): fix code style

charlie 3 年之前
父节点
当前提交
a33bb0cad1
共有 1 个文件被更改,包括 13 次插入14 次删除
  1. 13 14
      libs/src/LSPlugin.user.ts

+ 13 - 14
libs/src/LSPlugin.user.ts

@@ -586,22 +586,21 @@ export class LSPluginUser
               const handler = args[0]
               caller[f](type, handler)
 
-  const unlisten = () => {
-    caller.off(type, handler)
-    if (!caller.listenerCount(type)) {
-      that.App._uninstallPluginHook(pid, type)
-    }
-  }
-  
-  if (!isOff) {
-    that.App._installPluginHook(pid, type)
-  } else {
-    unlisten()
-    return
-  }
+              const unlisten = () => {
+                caller.off(type, handler)
+                if (!caller.listenerCount(type)) {
+                  that.App._uninstallPluginHook(pid, type)
+                }
+              }
 
-  return unlisten
+              if (!isOff) {
+                that.App._installPluginHook(pid, type)
+              } else {
+                unlisten()
+                return
               }
+
+              return unlisten
             }
           }