Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-14 18:05:41 +00:00
parent 7b07a46cd8
commit 9745c4288d
+18
View File
@@ -70,9 +70,27 @@ export function ShareButton({ variant = 'default', autoOpen, onHandleChange, onV
streamRef.current = null;
setHandle(null);
setViewerCount(0);
onHandleChange?.(null);
onViewerCountChange?.(0);
toast.info('Transmissão encerrada');
};
// Auto-open dialog when requested by parent (in-XR HUD)
useEffect(() => {
if (autoOpen) setOpen(true);
}, [autoOpen]);
// Expose start/stop via window so XR HUD can trigger from inside the scene
useEffect(() => {
(window as unknown as { __trackSteelStartLive?: () => void; __trackSteelStopLive?: () => void }).__trackSteelStartLive = () => { if (!handle) start(); };
(window as unknown as { __trackSteelStopLive?: () => void }).__trackSteelStopLive = () => { if (handle) stop(); };
return () => {
delete (window as unknown as { __trackSteelStartLive?: () => void }).__trackSteelStartLive;
delete (window as unknown as { __trackSteelStopLive?: () => void }).__trackSteelStopLive;
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [handle]);
// Cleanup on unmount
useEffect(() => {
return () => {