🚀 Auto-deploy: melhoria no snap e medição AR em 25/05/2026 17:59:04
This commit is contained in:
@@ -881,14 +881,28 @@ export default function MeetingRoom() {
|
||||
// Estados da Sala (Conexão Supabase)
|
||||
const [peers, setPeers] = useState<Record<string, PeerData>>({});
|
||||
|
||||
// Lista de avatares permitidos (IDs de 1 a 20). Por padrão, todos estão ativos.
|
||||
// Lista de avatares permitidos (IDs de 1 a 20). Por padrão, tenta ler do localStorage.
|
||||
const [allowedAvatars, setAllowedAvatars] = useState<number[]>(() => {
|
||||
return Array.from({ length: 20 }, (_, i) => i + 1);
|
||||
try {
|
||||
const stored = localStorage.getItem('tsxr_meeting_allowed_avatars');
|
||||
if (stored) {
|
||||
const parsed = JSON.parse(stored);
|
||||
if (Array.isArray(parsed) && parsed.length >= 4 && parsed.length <= 10) {
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Falha ao ler tsxr_meeting_allowed_avatars do localStorage", e);
|
||||
}
|
||||
// Fallback padrão: 10 avatares balanceados (5 masculinos: 1-5, e 5 femininos: 11-15)
|
||||
return [1, 2, 3, 4, 5, 11, 12, 13, 14, 15];
|
||||
});
|
||||
const [isAvatarConfigOpen, setIsAvatarConfigOpen] = useState(false);
|
||||
|
||||
const updateAllowedAvatars = async (newAllowed: number[]) => {
|
||||
setAllowedAvatars(newAllowed);
|
||||
localStorage.setItem('tsxr_meeting_allowed_avatars', JSON.stringify(newAllowed));
|
||||
|
||||
if (isPresenter && channelRef.current) {
|
||||
console.log("⚙️ [MeetingRoom] Atualizando metadados de Presence com avatares permitidos:", newAllowed);
|
||||
await channelRef.current.track({
|
||||
|
||||
Reference in New Issue
Block a user