fix: synchronized sended messages for the same accounts

This commit is contained in:
yassinedorbozgithub 2024-12-04 11:38:43 +01:00
parent acf3663bd5
commit 9c884af233
2 changed files with 6 additions and 1 deletions

View File

@ -253,6 +253,11 @@ export class ChatService {
// Already existing user profile
// Exec lastvisit hook
this.eventEmitter.emit('hook:user:lastvisit', subscriber);
this.websocketGateway.broadcast(
subscriber,
event.getEventType(),
event._adapter.raw,
);
}
this.websocketGateway.broadcastSubscriberUpdate(subscriber);

View File

@ -250,7 +250,7 @@ const ChatProvider: React.FC<{
}
setMessages((prevMessages) => [
...prevMessages,
...prevMessages.filter((message) => message.mid !== newIOMessage.mid),
newIOMessage as TMessage,
]);
setScroll(0);