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) {
|
async syncHistory(chatId) {
|
||||||
return await this.pupPage.evaluate(async (chatId) => {
|
return await this.pupPage.evaluate(async (chatId) => {
|
||||||
const chat = await window.WWebJS.getChat(chatId);
|
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||||
if (chat.endOfHistoryTransferType === 0) {
|
const chat = window.Store.Chat.get(chatWid) ?? (await window.Store.Chat.find(chatWid));
|
||||||
|
if (chat?.endOfHistoryTransferType === 0) {
|
||||||
await window.Store.HistorySync.sendPeerDataOperationRequest(3, {
|
await window.Store.HistorySync.sendPeerDataOperationRequest(3, {
|
||||||
chatId: chat.id
|
chatId: chat.id
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue