mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): hotkeys dependency array
This commit is contained in:
parent
4895875ded
commit
8c0a061fa0
@ -15,13 +15,16 @@ export const UndoRedoButtonGroup = memo(() => {
|
|||||||
const handleUndo = useCallback(() => {
|
const handleUndo = useCallback(() => {
|
||||||
dispatch(undo());
|
dispatch(undo());
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
useHotkeys(['meta+z', 'ctrl+z'], handleUndo, { enabled: mayUndo, preventDefault: true }, [mayUndo, undo]);
|
useHotkeys(['meta+z', 'ctrl+z'], handleUndo, { enabled: mayUndo, preventDefault: true }, [mayUndo, handleUndo]);
|
||||||
|
|
||||||
const mayRedo = useAppSelector((s) => s.regionalPrompts.future.length > 0);
|
const mayRedo = useAppSelector((s) => s.regionalPrompts.future.length > 0);
|
||||||
const handleRedo = useCallback(() => {
|
const handleRedo = useCallback(() => {
|
||||||
dispatch(redo());
|
dispatch(redo());
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
useHotkeys(['meta+shift+z', 'ctrl+shift+z'], handleRedo, { enabled: mayRedo, preventDefault: true }, [mayRedo, redo]);
|
useHotkeys(['meta+shift+z', 'ctrl+shift+z'], handleRedo, { enabled: mayRedo, preventDefault: true }, [
|
||||||
|
mayRedo,
|
||||||
|
handleRedo,
|
||||||
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user