FIX: Status da conexão retorna CONNECTED para o frontend exibir os chats
Some checks are pending
Deploy Dev / deploy (push) Waiting to run
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:
parent
fd46eade07
commit
876ab6ec8b
@ -44,6 +44,7 @@ export class WhatsappGateway implements OnGatewayInit, OnGatewayConnection, OnGa
|
|||||||
|
|
||||||
handleConnection(client: Socket) {
|
handleConnection(client: Socket) {
|
||||||
this.logger.log(`Client connected: ${client.id} (${client.data.user?.username || 'usuario desconhecido'})`);
|
this.logger.log(`Client connected: ${client.id} (${client.data.user?.username || 'usuario desconhecido'})`);
|
||||||
|
client.emit('status', 'CONNECTED');
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDisconnect(client: Socket) {
|
handleDisconnect(client: Socket) {
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export class WhatsappService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getStatus() {
|
getStatus() {
|
||||||
return 'META_API';
|
return 'CONNECTED';
|
||||||
}
|
}
|
||||||
|
|
||||||
async getChats() {
|
async getChats() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user