🚀 Auto-deploy: melhoria no snap e medição AR em 25/05/2026 00:40:00
This commit is contained in:
@@ -623,6 +623,21 @@ export default function MeetingRoom() {
|
||||
sectionInvert: false
|
||||
});
|
||||
|
||||
// Carrega modificações da peça vindas do Viewer se houver
|
||||
useEffect(() => {
|
||||
const savedState = localStorage.getItem('tsxr_initial_meeting_state');
|
||||
if (savedState) {
|
||||
try {
|
||||
const parsed = JSON.parse(savedState) as PresentationState;
|
||||
setPresentationState(parsed);
|
||||
console.log('🔄 [MeetingRoom] Estado inicial carregado do Viewer:', parsed);
|
||||
} catch (err) {
|
||||
console.error('Falha ao carregar estado inicial do Viewer', err);
|
||||
}
|
||||
localStorage.removeItem('tsxr_initial_meeting_state');
|
||||
}
|
||||
}, []);
|
||||
|
||||
const channelRef = useRef<ReturnType<typeof supabase.channel> | null>(null);
|
||||
const chatScrollRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -799,6 +814,16 @@ export default function MeetingRoom() {
|
||||
empresa: empresa.trim() || 'SteelXR Corp',
|
||||
joinedAt: new Date().toISOString(),
|
||||
});
|
||||
|
||||
// Se for o apresentador, propaga o estado inicial de apresentação (vinda do Viewer) para todos
|
||||
if (isPresenter) {
|
||||
channel.send({
|
||||
type: 'broadcast',
|
||||
event: 'presentation_update',
|
||||
payload: presentationState
|
||||
});
|
||||
}
|
||||
|
||||
setInRoom(true);
|
||||
toast.success(`Entrou na sala de reunião: ${finalRoomId}`);
|
||||
navigate(`/meeting/${finalRoomId}`, { replace: true });
|
||||
|
||||
Reference in New Issue
Block a user