fix(client): update local pts/qts before dispatching the update

This commit is contained in:
teidesu 2021-08-04 13:16:08 +03:00
parent a3cf0c526a
commit c943391e15

View file

@ -692,6 +692,20 @@ async function _processSingleUpdate(
)
}
// update local pts/qts
if (pts) {
if (channelId) {
this._cpts[channelId] = pts
this._cptsMod[channelId] = pts
} else {
this._pts = pts
}
}
if (qts) {
this._qts = qts
}
if (isDummyUpdate(upd) || noDispatch) {
// we needed to check pts/qts, so we couldn't return right away
return
@ -735,20 +749,6 @@ async function _processSingleUpdate(
this._dispatchUpdate(upd, peers.users, peers.chats)
}
// update local pts/qts
if (pts) {
if (channelId) {
this._cpts[channelId] = pts
this._cptsMod[channelId] = pts
} else {
this._pts = pts
}
}
if (qts) {
this._qts = qts
}
}
/**