Skip to content

Commit

Permalink
Fixed inline results when editor don't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioszabo committed Jun 9, 2020
1 parent ab79f5a commit 4525893
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/chlorine/ui/inline_results.cljs
Expand Up @@ -36,15 +36,15 @@
first)))

(s/defn new-result [data :- schemas/EvalData]
(let [id (:id data)
range (:range data)
{:keys [editor]} (:editor-data data)
_ (when-let [old-marker (find-result editor range)]
(.destroy old-marker))
div (create-result id editor range)]
(doto div
(aset "classList" "chlorine result-overlay native-key-bindings")
(aset "innerHTML" "<div><span class='repl-tooling icon loading'></span></div>"))))
(when-let [editor (-> data :editor-data :editor)]
(let [id (:id data)
range (:range data)
_ (when-let [old-marker (find-result editor range)]
(.destroy old-marker))
div (create-result id editor range)]
(doto div
(aset "classList" "chlorine result-overlay native-key-bindings")
(aset "innerHTML" "<div><span class='repl-tooling icon loading'></span></div>")))))

(s/defn update-result [result :- schemas/EvalResult]
(let [id (:id result)
Expand Down

0 comments on commit 4525893

Please sign in to comment.