From 0f531ff177e8e7e1cb2bc30a409be4b521724b6f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 29 Feb 2024 16:52:37 -0500 Subject: [PATCH] fix: unable to add a page :default property value --- src/main/frontend/handler/editor/lifecycle.cljs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/handler/editor/lifecycle.cljs b/src/main/frontend/handler/editor/lifecycle.cljs index eb1259d77..ecd083407 100644 --- a/src/main/frontend/handler/editor/lifecycle.cljs +++ b/src/main/frontend/handler/editor/lifecycle.cljs @@ -35,10 +35,11 @@ [_old-state state] (let [new-block (:block (first (:rum/args state))) repo (state/get-current-repo)] - (when (not= (string/trim (state/get-edit-content)) - (string/trim (:block/content new-block))) - (util/set-change-value (state/get-input) - (block-handler/sanity-block-content repo (get new-block :block/format :markdown) (:block/content new-block))))) + (when (not= (some-> (state/get-edit-content) string/trim) + (some-> (:block/content new-block) string/trim)) + (when-let [input (state/get-input)] + (util/set-change-value input + (block-handler/sanity-block-content repo (get new-block :block/format :markdown) (:block/content new-block)))))) (keyboards-handler/esc-save! state) state)