fix: wrong right click menu for page :default property

Fixes logseq/db-test#51. Only fixes :default property as other property
types don't have block context set
This commit is contained in:
Gabriel Horner
2024-09-04 13:36:25 -04:00
parent 616adaec8a
commit e4f585f4bf

View File

@@ -783,18 +783,18 @@
(let [show!
(fn [content]
(shui/popup-show! e
(fn [{:keys [id]}]
[:div {:on-click #(shui/popup-hide! id)
:data-keep-selection true}
content])
{:on-before-hide state/dom-clear-selection!
:on-after-hide state/state-clear-selection!
:content-props {:class "w-[280px] ls-context-menu-content"}
:as-dropdown? true}))
(fn [{:keys [id]}]
[:div {:on-click #(shui/popup-hide! id)
:data-keep-selection true}
content])
{:on-before-hide state/dom-clear-selection!
:on-after-hide state/state-clear-selection!
:content-props {:class "w-[280px] ls-context-menu-content"}
:as-dropdown? true}))
handled
(cond
page
(and page (not block-id))
(do
(show! (cp-content/page-title-custom-context-menu-content page-entity))
(state/set-state! :page-title/context nil))