Skip to content

Commit 485376d

Browse files
author
Michal Pisanko
committed
close empty editors rather than send empty statements for eval
1 parent de77675 commit 485376d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cljs/xt_play/view.cljs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@
8888

8989
(defn- update-db-from-editor-refs [tx-refs]
9090
(doseq [tx-ref @tx-refs]
91-
(rf/dispatch [::tx-batch/assoc (:id @tx-ref) :txs (get-value tx-ref)])))
91+
(let [value (get-value tx-ref)]
92+
(if (empty? value)
93+
(rf/dispatch [::tx-batch/delete (:id @tx-ref)])
94+
(rf/dispatch [::tx-batch/assoc (:id @tx-ref) :txs (get-value tx-ref)])))))
9295

9396
(defn- run-button [tx-refs]
9497
(let [loading? (rf/subscribe [::run/loading?])

0 commit comments

Comments
 (0)