diff --git a/frontend/src/app/main/data/plugins.cljs b/frontend/src/app/main/data/plugins.cljs index d20e65727..a2c2db7cb 100644 --- a/frontend/src/app/main/data/plugins.cljs +++ b/frontend/src/app/main/data/plugins.cljs @@ -26,6 +26,13 @@ (catch :default e (.error js/console "Error" e)))) +(defn close-plugin! + [{:keys [plugin-id]}] + (try + (.ɵunloadPlugin ^js ug/global plugin-id) + (catch :default e + (.error js/console "Error" e)))) + (defn delay-open-plugin [plugin] (ptk/reify ::delay-open-plugin diff --git a/frontend/src/app/main/ui/workspace/plugins.cljs b/frontend/src/app/main/ui/workspace/plugins.cljs index 693eba0b4..0b1ce3730 100644 --- a/frontend/src/app/main/ui/workspace/plugins.cljs +++ b/frontend/src/app/main/ui/workspace/plugins.cljs @@ -141,6 +141,7 @@ (st/emit! (ptk/event ::ev/event {::ev/name "remove-plugin" :name (:name plugin) :host (:host plugin)})) + (dp/close-plugin! plugin) (preg/remove-plugin! plugin) (reset! plugins-state* (preg/plugins-list)))))]