diff --git a/src/main/frontend/handler/whiteboard.cljs b/src/main/frontend/handler/whiteboard.cljs index a525386d4..aebd5a0e2 100644 --- a/src/main/frontend/handler/whiteboard.cljs +++ b/src/main/frontend/handler/whiteboard.cljs @@ -153,13 +153,14 @@ (compute-tx app tl-page new-id-nonces db-id-nonces page-name replace?) tx-data (concat delete-blocks [page-block] upserted-blocks) new-shapes (get-in metadata [:data :new-shapes]) + deleted-shapes (get-in metadata [:data :deleted-shapes]) metadata' (cond ;; group (some #(= "group" (:type %)) new-shapes) (assoc metadata :whiteboard/op :group) ;; ungroup - (every? #(= "group" (:type %)) (get-in metadata [:data :deleted-shapes])) + (and (not-empty deleted-shapes) (every? #(= "group" (:type %)) deleted-shapes)) (assoc metadata :whiteboard/op :un-group) ;; arrow