fix: don't call event handler for new messages directly to puppeteer
This was creating performance issues, specially on startup when the initial set of messages were being loaded for a client with many chats.
This commit is contained in:
parent
b41414cfbf
commit
8bdecadba4
1 changed files with 1 additions and 1 deletions
|
|
@ -277,7 +277,7 @@ class Client extends EventEmitter {
|
|||
});
|
||||
|
||||
await page.evaluate(() => {
|
||||
window.Store.Msg.on('add', window.onAddMessageEvent);
|
||||
window.Store.Msg.on('add', (msg) => { if(msg.isNewMsg) window.onAddMessageEvent(msg);});
|
||||
window.Store.Msg.on('change', window.onChangeMessageEvent);
|
||||
window.Store.Msg.on('change:type', window.onChangeMessageTypeEvent);
|
||||
window.Store.Msg.on('change:ack', window.onMessageAckEvent);
|
||||
|
|
|
|||
Loading…
Reference in a new issue