mirror of
https://github.com/logseq/logseq.git
synced 2026-04-26 07:05:10 +00:00
enhance(plugin): add load events
This commit is contained in:
@@ -767,7 +767,7 @@
|
||||
(let [text (state/sub :plugin/indicator-text)]
|
||||
(when-not (= text "END")
|
||||
[:div.flex.align-items.justify-center.h-screen.w-full.preboot-loading
|
||||
[:span.flex.items-center.justify-center.w-60.flex-col
|
||||
[:span.flex.items-center.justify-center.flex-col
|
||||
[:small.scale-250.opacity-70.mb-10.animate-pulse (svg/logo)]
|
||||
[:small.block.text-sm.relative.opacity-50 {:style {:right "-8px"}} text]]])))
|
||||
|
||||
@@ -779,8 +779,6 @@
|
||||
(rum/mount
|
||||
(lsp-indicator) el))
|
||||
|
||||
(state/set-state! :plugin/indicator-text "LOADING")
|
||||
|
||||
(-> (p/let [root (init-ls-dotdir-root)
|
||||
_ (.setupPluginCore js/LSPlugin (bean/->js {:localUserConfigRoot root :dotConfigRoot root}))
|
||||
|
||||
@@ -799,6 +797,10 @@
|
||||
(register-plugin
|
||||
(bean/->clj (.parse js/JSON (.stringify js/JSON pl))))))
|
||||
|
||||
(.on "beforeload"
|
||||
(fn [^js pl]
|
||||
(state/set-state! :plugin/indicator-text (util/format "Load plugin: %s..." (.-id pl)))))
|
||||
|
||||
(.on "reloaded"
|
||||
(fn [^js pl]
|
||||
(register-plugin
|
||||
|
||||
Reference in New Issue
Block a user