Browse Source

fix(plugin): fix code style

charlie 3 years ago
parent
commit
a33bb0cad1
1 changed files with 13 additions and 14 deletions
  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
             }
           }