diff --git a/src/components/atoms/canvas.tsx b/src/components/atoms/canvas.tsx index 44b09367..32aadaba 100644 --- a/src/components/atoms/canvas.tsx +++ b/src/components/atoms/canvas.tsx @@ -45,10 +45,16 @@ const ConfirmationBox = ({ selector, onYes, onNo }: { selector: string; onYes: ( const Canvas = ({ width, height, onCreateRef, highlighterData }: CanvasProps) => { const canvasRef = useRef(null); const { socket } = useSocketStore(); - const { setLastAction } = useGlobalInfoStore(); + const { setLastAction, lastAction } = useGlobalInfoStore(); const [showConfirmation, setShowConfirmation] = useState(false); const [pendingClick, setPendingClick] = useState(null); + const notifyLastAction = (action: string) => { + if (lastAction !== action) { + setLastAction(action); + } + }; + const lastMousePosition = useRef({ x: 0, y: 0 }); const onMouseEvent = useCallback((event: MouseEvent) => {