0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00

🐛 Close plugin if open when installed

This commit is contained in:
alonso.torres 2024-10-09 10:50:56 +02:00
parent 6327286328
commit 379770343a
2 changed files with 8 additions and 0 deletions

View file

@ -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

View file

@ -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)))))]