Skip to content

Commit

Permalink
fix: Merge pull request #112 from Hummer12007/undo-shortcut
Browse files Browse the repository at this point in the history
Undo shortcut
  • Loading branch information
seveibar authored Nov 23, 2020
2 parents a0bb511 + 4cb4859 commit e2aaa86
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ShortcutsManager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ export const defaultHotkeys = [
description: "Delete selected region",
binding: "Delete",
},
{
id: "undo",
description: "Undo latest change",
binding: "Ctrl+z",
},
]
export const defaultKeyMap = {}
for (const { id, binding } of defaultHotkeys) defaultKeyMap[id] = binding
Expand Down Expand Up @@ -130,6 +135,11 @@ export const useDispatchHotkeyHandlers = ({ dispatch }) => {
type: "DELETE_SELECTED_REGION",
})
},
undo: () => {
dispatch({
type: "RESTORE_HISTORY",
})
},
// TODO
// exit_sample: () => {
// dispatch({
Expand Down

0 comments on commit e2aaa86

Please sign in to comment.