fix: disable nonsensical things for publishing

Disable graph creation and more ways to alter blocks in publishing
This commit is contained in:
Gabriel Horner
2025-07-08 15:52:38 -04:00
parent 379eb4d8fb
commit 101fa65012
3 changed files with 6 additions and 2 deletions

View File

@@ -2814,7 +2814,7 @@
:on-click #(db-property-handler/delete-property-value! (:db/id block) :block/tags (:db/id tag))}
"Remove tag"))])
popup-opts))}
(if (and @*hover? (not private-tag?))
(if (and @*hover? (not private-tag?) (not config/publishing?))
[:a.inline-flex.text-muted-foreground
{:title "Remove this tag"
:style {:margin-top 1

View File

@@ -8,6 +8,7 @@
[frontend.components.page :as page]
[frontend.components.profiler :as profiler]
[frontend.components.shortcut-help :as shortcut-help]
[frontend.config :as config]
[frontend.context.i18n :refer [t]]
[frontend.date :as date]
[frontend.db :as db]
@@ -437,7 +438,7 @@
(state/sidebar-add-block! repo "help" :help))}
(t :right-side-bar/help)]]
(when (state/sub [:ui/developer-mode?])
(when (and (state/sub [:ui/developer-mode?]) (not config/publishing?))
[:div.text-sm
[:button.button.cp__right-sidebar-settings-btn {:on-click (fn [_e]
(state/sidebar-add-block! repo "rtc" :rtc))}

View File

@@ -462,9 +462,11 @@
:binding []}
:graph/add {:fn (fn [] (route-handler/redirect! {:to :graphs}))
:inactive config/publishing?
:binding []}
:graph/db-add {:fn #(state/pub-event! [:graph/new-db-graph])
:inactive config/publishing?
:binding false}
:graph/db-save {:fn #(state/pub-event! [:graph/save-db-to-disk])
@@ -541,6 +543,7 @@
:editor/quick-add {:binding (if mac? "mod+e" "mod+alt+e")
:db-graph? true
:inactive config/publishing?
:fn editor-handler/quick-add}
:editor/jump {:binding "mod+j"
:fn jump-handler/jump-to}