enhance(plugin): unlink plugins for web

This commit is contained in:
charlie
2024-12-28 11:48:26 +08:00
parent 23166186b0
commit ca03681754
4 changed files with 36 additions and 19 deletions

View File

@@ -62,6 +62,11 @@
(let [^js e (js/window.EventEmitter3.)]
(set! (. js/window -apis) e))))
(defn unlink-plugin-for-web!
[key]
(invoke-exported-api :unlink_installed_web_plugin key)
(invoke-exported-api :unlink_plugin_user_settings key))
(defn load-plugin-preferences
[]
(-> (invoke-exported-api :load_user_preferences)
@@ -817,7 +822,9 @@
(.on "unlink-plugin" (fn [pid]
(let [pid (keyword pid)]
(ipc/ipc "uninstallMarketPlugin" (name pid)))))
(if (util/electron?)
(ipc/ipc :uninstallMarketPlugin (name pid))
(unlink-plugin-for-web! pid)))))
(.on "beforereload" (fn [^js pl]
(let [pid (.-id pl)]