mirror of
https://github.com/logseq/logseq.git
synced 2026-04-26 07:05:10 +00:00
fix(plugin): repeat registration key to plugin ui items
This commit is contained in:
@@ -317,11 +317,13 @@
|
||||
(swap! state/state medley/dissoc-in [:plugin/simple-commands (keyword pid)]))
|
||||
|
||||
(defn register-plugin-ui-item
|
||||
[pid {:keys [type] :as opts}]
|
||||
[pid {:keys [key type] :as opts}]
|
||||
(when-let [pid (keyword pid)]
|
||||
(when (contains? (:plugin/installed-plugins @state/state) pid)
|
||||
(swap! state/state update-in [:plugin/installed-ui-items pid]
|
||||
(fnil conj []) [type opts pid])
|
||||
(let [items (or (get-in @state/state [:plugin/installed-ui-items pid]) [])
|
||||
items (filter #(not= key (:key (second %))) items)]
|
||||
(swap! state/state assoc-in [:plugin/installed-ui-items pid]
|
||||
(conj items [type opts pid])))
|
||||
true)))
|
||||
|
||||
(defn unregister-plugin-ui-items
|
||||
|
||||
Reference in New Issue
Block a user