fix(RealityOverridePage): update touch handling to pointer events and adjust double-tap timing

This commit is contained in:
Jaime Idolpx 2026-06-09 00:01:26 -04:00
parent 39ed486173
commit fe2b677bc3

View File

@ -115,9 +115,10 @@ export default function RealityOverridePage({ onBack }: { onBack: () => void })
localStorage.setItem('ro-bg', next ? 'on' : 'off');
};
const handleTouchEnd = () => {
const handlePointerDown = (e: React.PointerEvent) => {
if (!e.isPrimary) return;
const now = Date.now();
if (now - lastTapRef.current < 300) { toggleBg(); lastTapRef.current = 0; }
if (now - lastTapRef.current < 400) { toggleBg(); lastTapRef.current = 0; }
else { lastTapRef.current = now; }
};
@ -319,8 +320,7 @@ export default function RealityOverridePage({ onBack }: { onBack: () => void })
return (
<div
className="relative w-full h-full bg-black overflow-hidden"
onDoubleClick={toggleBg}
onTouchEnd={handleTouchEnd}
onPointerDown={handlePointerDown}
>
{/* Star field — always visible beneath the vortex */}