improve(plugin): add theme changed hook

This commit is contained in:
charlie
2022-06-13 17:40:09 +08:00
committed by Tienson Qin
parent e4b71a4ccf
commit f3bedb200e
6 changed files with 9 additions and 7 deletions

View File

@@ -605,7 +605,7 @@
(clear-commands! pid)
(unregister-plugin-themes pid)))
(.on "theme-changed" (fn [^js themes]
(.on "themes-changed" (fn [^js themes]
(swap! state/state assoc :plugin/installed-themes
(vec (mapcat (fn [[pid vs]] (mapv #(assoc % :pid pid) (bean/->clj vs))) (bean/->clj themes))))))
@@ -616,6 +616,7 @@
(when mode
(state/set-custom-theme! mode theme)
(state/set-theme-mode! mode))
(hook-plugin-app :theme-changed theme)
(state/set-state! :plugin/selected-theme url))))
(.on "reset-custom-theme" (fn [^js themes]