From b28117da4c8d68bca9e9f32e9224bfe9655354e6 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Mon, 10 Oct 2022 10:35:08 +0100 Subject: [PATCH] fix: don't error out when re-frame-10x is missing --- src/cljs/athens/util.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cljs/athens/util.cljs b/src/cljs/athens/util.cljs index df091b8196..2f91951fdc 100644 --- a/src/cljs/athens/util.cljs +++ b/src/cljs/athens/util.cljs @@ -264,21 +264,21 @@ [] (when config/debug? (let [el-10x (getElement "--re-frame-10x--") - display-10x (.. el-10x -style -display)] + display-10x (and el-10x (.. el-10x -style -display))] (not (= "none" display-10x))))) (defn open-10x [] (when config/debug? - (let [el (js/document.querySelector "#--re-frame-10x--")] + (when-let [el (js/document.querySelector "#--re-frame-10x--")] (setProperties el (clj->js {"style" "display: block"}))))) (defn hide-10x [] (when config/debug? - (let [el (js/document.querySelector "#--re-frame-10x--")] + (when-let [el (js/document.querySelector "#--re-frame-10x--")] (setProperties el (clj->js {"style" "display: none"})))))