FIX: Status da conexão retorna CONNECTED para o frontend exibir os chats
Some checks are pending
Deploy Dev / deploy (push) Waiting to run

O frontend bloqueia loadChats() quando whatsappStatus !== 'CONNECTED'.
Com a Meta API, getStatus() retornava 'META_API', zerando a lista de
conversas a cada refresh. Corrigido para retornar 'CONNECTED' e o gateway
agora emite o status ao conectar para atualizar o frontend via socket.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Rafael Alves Lopes 2026-06-19 16:35:00 -03:00
parent fd46eade07
commit 876ab6ec8b
2 changed files with 2 additions and 1 deletions

View File

@ -44,6 +44,7 @@ export class WhatsappGateway implements OnGatewayInit, OnGatewayConnection, OnGa
handleConnection(client: Socket) {
this.logger.log(`Client connected: ${client.id} (${client.data.user?.username || 'usuario desconhecido'})`);
client.emit('status', 'CONNECTED');
}
handleDisconnect(client: Socket) {

View File

@ -52,7 +52,7 @@ export class WhatsappService {
}
getStatus() {
return 'META_API';
return 'CONNECTED';
}
async getChats() {