fix: sanity if room prev_batch null, populate it

This commit is contained in:
td 2025-05-06 11:31:38 +02:00
parent 4721adde22
commit ec855ee525
No known key found for this signature in database
GPG Key ID: 62A30523D4D6CE28
1 changed files with 3 additions and 2 deletions

View File

@ -2992,7 +2992,8 @@ class Client extends MatrixApi {
/// [InvitedRoomUpdate] doesn't have prev_batch, so we want to set it in case
/// the room first appeared in sync update when membership was invite.
if ((rooms[roomIndex].membership == Membership.invite ||
chatUpdate.timeline?.limited == true) &&
chatUpdate.timeline?.limited == true ||
rooms[roomIndex].prev_batch == null) &&
chatUpdate.timeline?.prevBatch != null) {
rooms[roomIndex].prev_batch = chatUpdate.timeline?.prevBatch;
}