mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user