fix(plugin): unnecessary re-render for the page header slots

pull/11458/head
charlie 2024-08-05 10:25:42 +08:00
parent cd12e4e0dd
commit adda2b6bf2
1 changed files with 10 additions and 5 deletions

View File

@ -474,6 +474,15 @@
(when-let [path-page-name (get-path-page-name state page-name)]
(util/page-name-sanity-lc path-page-name)))
(rum/defc lsp-pagebar-slot <
rum/static
[]
(when (not config/publishing?)
(when config/lsp-enabled?
[:div.flex.flex-row
(plugins/hook-ui-slot :page-head-actions-slotted nil)
(plugins/hook-ui-items :pagebar)])))
;; A page is just a logical block
(rum/defcs ^:large-vars/cleanup-todo page-inner < rum/reactive db-mixins/query
(rum/local false ::all-collapsed?)
@ -543,11 +552,7 @@
:preview? preview?
:*hover? (::hover-title? state)
:*show-page-info? (::show-page-info? state)}))
(when (not config/publishing?)
(when config/lsp-enabled?
[:div.flex.flex-row
(plugins/hook-ui-slot :page-head-actions-slotted nil)
(plugins/hook-ui-items :pagebar)]))])
(lsp-pagebar-slot)])
(cond
(and db-based? (not block?))