From bae513f5618bc5cf829ad12a27f58c395ee0dfcb Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 23 Jul 2024 17:10:28 +0530 Subject: [PATCH] feat: use notify last action --- src/components/atoms/canvas.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/atoms/canvas.tsx b/src/components/atoms/canvas.tsx index 32aadaba..0f32d4a6 100644 --- a/src/components/atoms/canvas.tsx +++ b/src/components/atoms/canvas.tsx @@ -72,7 +72,7 @@ const Canvas = ({ width, height, onCreateRef, highlighterData }: CanvasProps) => x: coordinates.x, y: coordinates.y, }); - setLastAction('move'); + notifyLastAction('move'); } break; case 'wheel': @@ -82,7 +82,7 @@ const Canvas = ({ width, height, onCreateRef, highlighterData }: CanvasProps) => deltaY: Math.round(wheelEvent.deltaY), }; socket.emit('input:wheel', deltas); - setLastAction('scroll'); + notifyLastAction('scroll'); break; default: console.log('Default mouseEvent registered'); @@ -96,7 +96,7 @@ const Canvas = ({ width, height, onCreateRef, highlighterData }: CanvasProps) => switch (event.type) { case 'keydown': socket.emit('input:keydown', { key: event.key, coordinates: lastMousePosition.current }); - setLastAction(`${event.key} pressed`); + notifyLastAction(`${event.key} pressed`); break; case 'keyup': socket.emit('input:keyup', event.key); @@ -133,7 +133,7 @@ const Canvas = ({ width, height, onCreateRef, highlighterData }: CanvasProps) => height ); socket.emit('input:mousedown', mappedCoordinates); - setLastAction('click'); + notifyLastAction('click'); } setShowConfirmation(false); setPendingClick(null);