Fix getChats (#5779)

* Fix: getChats -> getChatModel -> GroupMetadata and NewsletterMetadata

* Fix module change
This commit is contained in:
BenyFilho 2026-01-30 05:50:19 -03:00 • committed by GitHub
commit 207a5ad104
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -645,7 +645,8 @@ exports.LoadUtils = () => {
if (chat.groupMetadata) {
model.isGroup = true;
const chatWid = window.Store.WidFactory.createWid(chat.id._serialized);
await window.Store.GroupMetadata.update(chatWid);
const groupMetadata = window.Store.GroupMetadata || window.Store.WAWebGroupMetadataCollection;
await groupMetadata.update(chatWid);
chat.groupMetadata.participants._models
.filter(x => x.id?._serialized?.endsWith('@lid'))
.forEach(x => x.contact?.phoneNumber && (x.id = x.contact.phoneNumber));
@ -654,7 +655,8 @@ exports.LoadUtils = () => {
}
if (chat.newsletterMetadata) {
await window.Store.NewsletterMetadataCollection.update(chat.id);
const newsletterMetadata = window.Store.NewsletterMetadataCollection || window.Store.WAWebNewsletterMetadataCollection;
await newsletterMetadata.update(chat.id);
model.channelMetadata = chat.newsletterMetadata.serialize();
model.channelMetadata.createdAtTs = chat.newsletterMetadata.creationTime;
}