From 35770a488568e575ce73fdd559c048a1124c3bd0 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 13 Oct 2022 00:25:48 +0800 Subject: [PATCH] fix: nil check --- src/main/logseq/api.cljs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/logseq/api.cljs b/src/main/logseq/api.cljs index 7841753f5..59baba417 100644 --- a/src/main/logseq/api.cljs +++ b/src/main/logseq/api.cljs @@ -48,8 +48,8 @@ (fn [a] (cond (keyword? a) - (cond-> (name a) - camel-case? + (cond-> (name a) + camel-case? (csk/->camelCase)) (uuid? a) (str a) @@ -431,12 +431,14 @@ (fn [content] (when-let [input-id (state/get-edit-input-id)] (commands/simple-insert! input-id content {}) - (.focus (gdom/getElement input-id))))) + (when-let [input (gdom/getElement input-id)] + (.focus input))))) (def ^:export restore_editing_cursor (fn [] (when-let [input-id (state/get-edit-input-id)] - (.focus (gdom/getElement input-id))))) + (when-let [input (gdom/getElement input-id)] + (.focus input))))) (def ^:export get_editing_cursor_position (fn []