From c5baa65788ca0fc152b473fed136b45f125f17d1 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:58:12 +0000 Subject: [PATCH] Automated linting update and features.json sync --- packages/studio-ui/src/components/UndoRedo.tsx | 17 ++++++++++------- .../tests/components/UndoRedo.test.tsx | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/studio-ui/src/components/UndoRedo.tsx b/packages/studio-ui/src/components/UndoRedo.tsx index c64d488ff..6c49b10cd 100644 --- a/packages/studio-ui/src/components/UndoRedo.tsx +++ b/packages/studio-ui/src/components/UndoRedo.tsx @@ -22,15 +22,18 @@ export default function UndoRedo(): JSX.Element { redo(); }, [redo]); - const handleUndoKeydown = useCallback((event: KeyboardEvent) => { - event.preventDefault() - if ((event.ctrlKey || event.metaKey) && event.key === "z") { - undo() - } - }, [undo]) + const handleUndoKeydown = useCallback( + (event: KeyboardEvent) => { + event.preventDefault(); + if ((event.ctrlKey || event.metaKey) && event.key === "z") { + undo(); + } + }, + [undo] + ); useEffect(() => { - document.addEventListener("keydown", handleUndoKeydown) + document.addEventListener("keydown", handleUndoKeydown); }, [handleUndoKeydown]); const disableUndo = pastStates.length === 0; diff --git a/packages/studio-ui/tests/components/UndoRedo.test.tsx b/packages/studio-ui/tests/components/UndoRedo.test.tsx index 50b47860c..043f84453 100644 --- a/packages/studio-ui/tests/components/UndoRedo.test.tsx +++ b/packages/studio-ui/tests/components/UndoRedo.test.tsx @@ -51,7 +51,7 @@ describe("Undo/redo", () => { expect(useStudioStore.getState().pages.activeComponentUUID).toBe( "searchbar-uuid" ); - await userEvent.keyboard('{Control>}z{/Control}') + await userEvent.keyboard("{Control>}z{/Control}"); expect(useStudioStore.getState().pages.activeComponentUUID).toBeUndefined(); }); @@ -60,7 +60,7 @@ describe("Undo/redo", () => { expect(useStudioStore.getState().pages.activeComponentUUID).toBe( "searchbar-uuid" ); - await userEvent.keyboard('{Meta>}z{/Meta}') + await userEvent.keyboard("{Meta>}z{/Meta}"); expect(useStudioStore.getState().pages.activeComponentUUID).toBeUndefined(); });