Skip to content

Commit

Permalink
Ensure mousetrap instance exists in unbindShortcut
Browse files Browse the repository at this point in the history
(cherry picked from commit 930742ae2c69a530afe60f76a5824f2722540df8)
  • Loading branch information
Taloth authored and mynameisbogdan committed Jul 5, 2023
1 parent 7eac11f commit 90e92c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/Components/keyboardShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ function keyboardShortcuts(WrappedComponent) {
};

unbindShortcut = (key) => {
delete this._mousetrapBindings[key];
this._mousetrap.unbind(key);
if (this._mousetrap != null) {
delete this._mousetrapBindings[key];
this._mousetrap.unbind(key);
}
};

unbindAllShortcuts = () => {
Expand Down

0 comments on commit 90e92c0

Please sign in to comment.