Fix Channels WhatsApp module change (#5787)

This commit is contained in:
BenyFilho 2026-01-30 10:31:07 -03:00 • committed by GitHub
commit 32e404292b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -572,10 +572,10 @@ exports.LoadUtils = () => {
if (isChannel) { if (isChannel) {
try { try {
chat = window.Store.NewsletterCollection.get(chatId); chat = window.Store.WAWebNewsletterMetadataCollection.get(chatId);
if (!chat) { if (!chat) {
await window.Store.ChannelUtils.loadNewsletterPreviewChat(chatId); await window.Store.ChannelUtils.loadNewsletterPreviewChat(chatId);
chat = await window.Store.NewsletterCollection.find(chatWid); chat = await window.Store.WAWebNewsletterMetadataCollection.find(chatWid);
} }
} catch (err) { } catch (err) {
chat = null; chat = null;
@ -625,7 +625,7 @@ exports.LoadUtils = () => {
}; };
window.WWebJS.getChannels = async () => { window.WWebJS.getChannels = async () => {
const channels = window.Store.NewsletterCollection.getModelsArray(); const channels = window.Store.WAWebNewsletterMetadataCollection.getModelsArray();
const channelPromises = channels?.map((channel) => window.WWebJS.getChatModel(channel, { isChannel: true })); const channelPromises = channels?.map((channel) => window.WWebJS.getChatModel(channel, { isChannel: true }));
return await Promise.all(channelPromises); return await Promise.all(channelPromises);
}; };