Web: Accounts: fixed keydown event unmount
This commit is contained in:
parent
02fc9583c6
commit
f50fdbfce1
@ -77,10 +77,10 @@ const useAccountsHotkeys = ({
|
||||
useEffect(() => {
|
||||
const throttledKeyDownEvent = throttle(onKeyDown, 300);
|
||||
|
||||
window.addEventListener("keydown", onKeyDown);
|
||||
window.addEventListener("keydown", throttledKeyDownEvent);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("keypress", throttledKeyDownEvent);
|
||||
window.removeEventListener("keydown", throttledKeyDownEvent);
|
||||
};
|
||||
}, [onKeyDown]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user