Merge pull request #1557 from famedly/nico/fix.pagination-end

fix: storing the end of history pagination
This commit is contained in:
Nicolas Werner 2023-09-19 12:27:52 +02:00 committed by GitHub
commit 3c21b672c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -233,7 +233,7 @@ abstract class DatabaseApi {
Future removeEvent(String eventId, String roomId);
Future setRoomPrevBatch(
String prevBatch,
String? prevBatch,
String roomId,
Client client,
);

View File

@ -944,7 +944,7 @@ class HiveCollectionsDatabase extends DatabaseApi {
@override
Future<void> setRoomPrevBatch(
String prevBatch, String roomId, Client client) async {
String? prevBatch, String roomId, Client client) async {
final raw = await _roomsBox.get(roomId);
if (raw == null) return;
final room = Room.fromJson(copyMap(raw), client);

View File

@ -885,7 +885,7 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
@override
Future<void> setRoomPrevBatch(
String prevBatch, String roomId, Client client) async {
String? prevBatch, String roomId, Client client) async {
final raw = await _roomsBox.get(roomId.toHiveKey);
if (raw == null) return;
final room = Room.fromJson(convertToJson(raw), client);

View File

@ -1281,7 +1281,7 @@ class Room {
if (client.database != null) {
await client.database?.transaction(() async {
if (storeInDatabase) {
await client.database?.setRoomPrevBatch(resp.end!, id, client);
await client.database?.setRoomPrevBatch(resp.end, id, client);
}
await loadFn();
});