Fix getChats (#5779)
* Fix: getChats -> getChatModel -> GroupMetadata and NewsletterMetadata * Fix module change
This commit is contained in:
parent
d5fd776356
commit
207a5ad104
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue