diff --git a/src/Client.js b/src/Client.js index 38f5af3..3f339ce 100644 --- a/src/Client.js +++ b/src/Client.js @@ -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 });