Skip to content

Commit

Permalink
feat: Trigger chat.new_message event for ciphertext msg after sync
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jul 10, 2022
1 parent 085a719 commit 3338cce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/chat/events/registerNewMessageEvent.ts
Expand Up @@ -24,6 +24,14 @@ function register() {
MsgStore.on('add', (msg: MsgModel) => {
if (msg.isNewMsg) {
queueMicrotask(() => {
if (msg.type === 'ciphertext') {
msg.once('change:type', () => {
queueMicrotask(() => {
internalEv.emit('chat.new_message', msg);
});
});
}

internalEv.emit('chat.new_message', msg);
});
}
Expand Down

0 comments on commit 3338cce

Please sign in to comment.