From e66d94efd9a6f4c33b3b9db39dd79b0d22f585e6 Mon Sep 17 00:00:00 2001 From: "A. Rifqi Yarzuq Arfani" Date: Wed, 4 Feb 2026 03:36:16 +0700 Subject: [PATCH] Fix update channel module (#5791) * Fix getChats (#5779) * Fix: getChats -> getChatModel -> GroupMetadata and NewsletterMetadata * Fix module change * fix: change wrong update module of channel * fix: correct reference to pupPage in deleteChannel method --------- Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com> Co-authored-by: Rajeh Taher --- src/Client.js | 2 +- src/util/Injected/Utils.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Client.js b/src/Client.js index f68491f..3ab2218 100644 --- a/src/Client.js +++ b/src/Client.js @@ -1996,7 +1996,7 @@ class Client extends EventEmitter { * @returns {Promise} Returns true if the operation completed successfully, false otherwise */ async deleteChannel(channelId) { - return await this.client.pupPage.evaluate(async (channelId) => { + return await this.pupPage.evaluate(async (channelId) => { const channel = await window.WWebJS.getChat(channelId, { getAsModel: false }); if (!channel) return false; try { diff --git a/src/util/Injected/Utils.js b/src/util/Injected/Utils.js index 4fdc45d..1c35569 100644 --- a/src/util/Injected/Utils.js +++ b/src/util/Injected/Utils.js @@ -572,10 +572,10 @@ exports.LoadUtils = () => { if (isChannel) { try { - chat = window.Store.WAWebNewsletterMetadataCollection.get(chatId); + chat = window.Store.WAWebNewsletterCollection.get(chatId); if (!chat) { await window.Store.ChannelUtils.loadNewsletterPreviewChat(chatId); - chat = await window.Store.WAWebNewsletterMetadataCollection.find(chatWid); + chat = await window.Store.WAWebNewsletterCollection.find(chatWid); } } catch (err) { chat = null; @@ -625,7 +625,7 @@ exports.LoadUtils = () => { }; window.WWebJS.getChannels = async () => { - const channels = window.Store.WAWebNewsletterMetadataCollection.getModelsArray(); + const channels = window.Store.WAWebNewsletterCollection.getModelsArray(); const channelPromises = channels?.map((channel) => window.WWebJS.getChatModel(channel, { isChannel: true })); return await Promise.all(channelPromises); };