Update Client.js (#3286)
fix: resolved issue with 'onPollVoteEvent' binding after logout - Fixed error: 'Failed to add page binding with name onPollVoteEvent: window["onPollVoteEvent"] already exists!' - The error occurred after logging out and attempting to reconnect. - Connection would get stuck in 'authenticated' state and never reach 'ready'. Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
This commit is contained in:
parent
5b0e0612de
commit
796a0a2367
1 changed files with 10 additions and 10 deletions
|
|
@ -685,7 +685,6 @@ class Client extends EventEmitter {
|
|||
*/
|
||||
this.emit(Events.MESSAGE_CIPHERTEXT, new Message(this, msg));
|
||||
});
|
||||
}
|
||||
|
||||
await this.pupPage.exposeFunction('onPollVoteEvent', (vote) => {
|
||||
const _vote = new PollVote(this, vote);
|
||||
|
|
@ -696,6 +695,7 @@ class Client extends EventEmitter {
|
|||
*/
|
||||
this.emit(Events.VOTE_UPDATE, _vote);
|
||||
});
|
||||
}
|
||||
|
||||
await this.pupPage.evaluate(() => {
|
||||
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(window.WWebJS.getMessageModel(msg)); });
|
||||
|
|
|
|||
Loading…
Reference in a new issue