feat: notify last action

This commit is contained in:
karishmas6
2024-07-23 17:08:55 +05:30
parent 7574d0aaa8
commit a2821b404e

View File

@@ -45,10 +45,16 @@ const ConfirmationBox = ({ selector, onYes, onNo }: { selector: string; onYes: (
const Canvas = ({ width, height, onCreateRef, highlighterData }: CanvasProps) => {
const canvasRef = useRef<HTMLCanvasElement>(null);
const { socket } = useSocketStore();
const { setLastAction } = useGlobalInfoStore();
const { setLastAction, lastAction } = useGlobalInfoStore();
const [showConfirmation, setShowConfirmation] = useState(false);
const [pendingClick, setPendingClick] = useState<Coordinates | null>(null);
const notifyLastAction = (action: string) => {
if (lastAction !== action) {
setLastAction(action);
}
};
const lastMousePosition = useRef<Coordinates>({ x: 0, y: 0 });
const onMouseEvent = useCallback((event: MouseEvent) => {