fix: WAWebSendReactionMsgAction call to use sendReactionToMsg method (#127101)
* update WAWebSendReactionMsgAction call to use sendReactionToMsg method
The WhatsApp Web internal API changed the WAWebSendReactionMsgAction module
from a directly callable function to an object with a sendReactionToMsg method.
Before:
await (window.require('WAWebSendReactionMsgAction'))(msg, reaction);
After:
await (window.require('WAWebSendReactionMsgAction')).sendReactionToMsg(msg, reaction);
This fixes the TypeError: window.require(...) is not a function error
thrown when attempting to react to messages.
* Refactor react method for improved readability
* Update Message.js
Co-authored-by: @BenyFilho
* Update Message.js
Co-authored-by: @Benyfilho
* Update Message.js
Co-authored-by: @BenyFilho
* Update Message.js
Co-authored-by: BenyFilho <BenyFilho@users.noreply.github.com>
---------
Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
Co-authored-by: BenyFilho <BenyFilho@users.noreply.github.com>
This commit is contained in:
parent
807efd502d
commit
03498ea477
1 changed files with 3 additions and 4 deletions
|
|
@ -485,10 +485,9 @@ class Message extends Base {
|
||||||
.Msg.getMessagesById([messageId])
|
.Msg.getMessagesById([messageId])
|
||||||
)?.messages?.[0];
|
)?.messages?.[0];
|
||||||
if (!msg) return null;
|
if (!msg) return null;
|
||||||
await window.require('WAWebSendReactionMsgAction')(
|
await window
|
||||||
msg,
|
.require('WAWebSendReactionMsgAction')
|
||||||
reaction,
|
.sendReactionToMsg(msg, reaction);
|
||||||
);
|
|
||||||
},
|
},
|
||||||
this.id._serialized,
|
this.id._serialized,
|
||||||
reaction,
|
reaction,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue