diff --git a/frontend/views/newwhats/hooks/inbox/useNewInboxBridge.ts b/frontend/views/newwhats/hooks/inbox/useNewInboxBridge.ts index 284bcec..0fce290 100644 --- a/frontend/views/newwhats/hooks/inbox/useNewInboxBridge.ts +++ b/frontend/views/newwhats/hooks/inbox/useNewInboxBridge.ts @@ -61,7 +61,7 @@ function chatToLegacy(c: ReturnType['chats'][0]): is_pinned: c.isPinned, is_archived: c.isArchived, bot_paused: c.botPaused ?? null, - labels: [], + labels: (c as any).labels ?? [], } } @@ -88,6 +88,7 @@ function messagesToLegacy(msgs: ReturnType['messag quoted_message_text: m.replyTo?.body ?? null, quoted_participant: m.replyTo ? (m.replyTo.fromMe ? 'me' : null) : null, participant: m.pushName ?? null, + reactions: m.reactions ?? null, senderJid: m.senderJid ?? null, sender_jid: m.senderJid ?? null, remote_jid: m.chatId, @@ -118,7 +119,9 @@ export function useNewInboxBridge() { // ── Carregar chats quando instância ativa muda ───────────────────────────── useEffect(() => { const { activeInstanceId } = instanceStore - if (!activeInstanceId) return + // Sem instância ativa (ex.: superadmin, ou instância resetada por não ser + // acessível) → esvazia a lista para NÃO deixar chats de outra sessão na tela. + if (!activeInstanceId) { chatStore.setChats([]); return } chatStore.loadChats(activeInstanceId) socketService.joinInstance(activeInstanceId) // Reconcilia nomes em background (cache 30min — leve em escala)