From 927277d7513ca6f810e35a81154835629e4647d5 Mon Sep 17 00:00:00 2001 From: NickWang Date: Fri, 20 Dec 2024 12:11:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20clean?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Client.js b/src/Client.js index 1208829035..b15baf0bac 100644 --- a/src/Client.js +++ b/src/Client.js @@ -20,7 +20,7 @@ const { LoadUtils } = require('./util/Injected/Utils'); const ChatFactory = require('./factories/ChatFactory'); const ContactFactory = require('./factories/ContactFactory'); const WebCacheFactory = require('./webCache/WebCacheFactory'); -const { ClientInfo, Message, MessageMedia, Contact, Location, Poll, PollVote, GroupNotification, Label, Call, Buttons, List, Reaction, Broadcast} = require('./structures'); +const { ClientInfo, Message, MessageMedia, Contact, Location, Poll, PollVote, GroupNotification, Label, Call, Buttons, List, Reaction, Broadcast, UrlLink, ProductMessage} = require('./structures'); const NoAuth = require('./authStrategies/NoAuth'); const {exposeFunctionIfAbsent} = require('./util/Puppeteer'); @@ -628,12 +628,12 @@ class Client extends EventEmitter { } }); - await page.exposeFunction('onContactNameChange', async (contact, newName, oldName) => { + await exposeFunctionIfAbsent(this.pupPage, 'onContactNameChange', async (contact, newName, oldName) => { const whatsappContact = await this.getContactById(contact.id); this.emit(Events.CONTACT_NAME_CHANGE, whatsappContact, newName, oldName); }); - await page.exposeFunction('onRemoveChatEvent', async (chat) => { + await exposeFunctionIfAbsent(this.pupPage, 'onRemoveChatEvent', async (chat) => { const _chat = await this.getChatById(chat.id); /**