Skip to content

Commit

Permalink
Check if any undos exist before undoing
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhanshuguptagit committed Jun 20, 2024
1 parent c72c0b3 commit 990f107
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bean/ui/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
(cond
(and (= (.-key e) "z") (or (.-ctrlKey e) (.-metaKey e))
(.-shiftKey e))
(rf/dispatch [:redo])
(when (undo/redos?) (rf/dispatch [:redo]))

(and (= (.-key e) "z") (or (.-ctrlKey e) (.-metaKey e)))
(rf/dispatch [:undo])
(when (undo/undos?) (rf/dispatch [:undo]))

(or (.-ctrlKey e) (.-metaKey e)
(= (.-key e) "Shift")
Expand Down

0 comments on commit 990f107

Please sign in to comment.