fix: chat instance retrieving in syncHistory (#3342)
This commit is contained in:
parent
bad202d2bc
commit
385e3cc59b
1 changed files with 3 additions and 2 deletions
|
|
@ -1762,8 +1762,9 @@ class Client extends EventEmitter {
|
|||
*/
|
||||
async syncHistory(chatId) {
|
||||
return await this.pupPage.evaluate(async (chatId) => {
|
||||
const chat = await window.WWebJS.getChat(chatId);
|
||||
if (chat.endOfHistoryTransferType === 0) {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
const chat = window.Store.Chat.get(chatWid) ?? (await window.Store.Chat.find(chatWid));
|
||||
if (chat?.endOfHistoryTransferType === 0) {
|
||||
await window.Store.HistorySync.sendPeerDataOperationRequest(3, {
|
||||
chatId: chat.id
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue