fix: update call handling for recent WhatsApp Web changes (#5775)
* fix: update call handling for recent WhatsApp Web changes Updated the call handling logic to accommodate the renaming of Store.Call to WAWebCallCollection in recent WhatsApp Web versions. This ensures that incoming calls are properly managed without breaking functionality. * Update Client.js --------- Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com> Co-authored-by: tuyuribr <45042245+tuyuribr@users.noreply.github.com>
This commit is contained in:
parent
b03680a70c
commit
6c3f10e1d2
1 changed files with 4 additions and 1 deletions
|
|
@ -756,7 +756,10 @@ class Client extends EventEmitter {
|
|||
window.Store.Msg.on('change:body change:caption', (msg, newBody, prevBody) => { window.onEditMessageEvent(window.WWebJS.getMessageModel(msg), newBody, prevBody); });
|
||||
window.Store.AppState.on('change:state', (_AppState, state) => { window.onAppStateChangedEvent(state); });
|
||||
window.Store.Conn.on('change:battery', (state) => { window.onBatteryStateChangedEvent(state); });
|
||||
window.Store.Call.on('add', (call) => { window.onIncomingCall(call); });
|
||||
const callCollection = (window.Store && window.Store.Call) || (window.Store && window.Store.WAWebCallCollection);
|
||||
if (callCollection && typeof callCollection.on === 'function') {
|
||||
callCollection.on('add', (call) => { window.onIncomingCall(call); });
|
||||
}
|
||||
window.Store.Chat.on('remove', async (chat) => { window.onRemoveChatEvent(await window.WWebJS.getChatModel(chat)); });
|
||||
window.Store.Chat.on('change:archive', async (chat, currState, prevState) => { window.onArchiveChatEvent(await window.WWebJS.getChatModel(chat), currState, prevState); });
|
||||
window.Store.Msg.on('add', (msg) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue