mirror of
https://github.com/logseq/logseq.git
synced 2026-04-25 14:44:53 +00:00
fix(plugin): package.json item cause ui error #11449
This commit is contained in:
@@ -252,10 +252,18 @@
|
||||
|
||||
(js/window.apis.addListener channel listener)))
|
||||
|
||||
(defn- normalize-plugin-metadata
|
||||
[metadata]
|
||||
(cond-> metadata
|
||||
(not (string? (:author metadata)))
|
||||
(assoc :author (or (get-in metadata [:author :name]) ""))))
|
||||
|
||||
(defn register-plugin
|
||||
[plugin-metadata]
|
||||
(when-let [pid (keyword (:id plugin-metadata))]
|
||||
(swap! state/state update-in [:plugin/installed-plugins] assoc pid plugin-metadata)))
|
||||
(some->> plugin-metadata
|
||||
(normalize-plugin-metadata)
|
||||
(swap! state/state update-in [:plugin/installed-plugins] assoc pid))))
|
||||
|
||||
(defn host-mounted!
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user