From db18b94ba32198f55ef3545b559191e1a9f6e309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Wed, 24 Jul 2024 10:46:40 +0200 Subject: [PATCH] chore(console): fix eslint warnings (#6941) --- .../ui/src/features/explorer-pane/zoom-pane.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/wing-console/console/ui/src/features/explorer-pane/zoom-pane.tsx b/apps/wing-console/console/ui/src/features/explorer-pane/zoom-pane.tsx index 09b574a3aef..f9083c328b4 100644 --- a/apps/wing-console/console/ui/src/features/explorer-pane/zoom-pane.tsx +++ b/apps/wing-console/console/ui/src/features/explorer-pane/zoom-pane.tsx @@ -205,7 +205,7 @@ export const ZoomPane = forwardRef((props, ref) => { } }); }, - [restrict], + [restrict, setViewTransform], ); useEvent("wheel", onWheel as (event: Event) => void, containerRef.current, { // Use passive: false to prevent the default behavior of scrolling the page. @@ -286,7 +286,7 @@ export const ZoomPane = forwardRef((props, ref) => { }); }); }, - [isSpacePressed, isDragging, restrict], + [isSpacePressed, isDragging, setViewTransform, restrict], ) as (event: Event) => void, ); @@ -316,7 +316,7 @@ export const ZoomPane = forwardRef((props, ref) => { setViewTransform((viewTransform) => { return restrict(viewTransform); }); - }, [restrict]); + }, [restrict, setViewTransform]); const throttledFixViewport = useRafThrottle(fixViewport); @@ -358,7 +358,7 @@ export const ZoomPane = forwardRef((props, ref) => { z: z, }); }); - }, [restrict]); + }, [restrict, setViewTransform]); const zoomOut = useCallback(() => { const container = containerRef.current; @@ -385,7 +385,7 @@ export const ZoomPane = forwardRef((props, ref) => { z: z, }); }); - }, [restrict]); + }, [restrict, setViewTransform]); const zoomToFit = useCallback( (viewport?: Viewport) => { @@ -421,7 +421,7 @@ export const ZoomPane = forwardRef((props, ref) => { }; }); }, - [boundingBox], + [boundingBox?.height, boundingBox?.width, setViewTransform], ); useImperativeHandle(