Merge pull request #1675 from famedly/krille/combine-lists-type-error

fix: Type error when combining dynamic lists
This commit is contained in:
Krille-chan 2024-01-04 09:03:00 +01:00 committed by GitHub
commit 872e565de1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1585,7 +1585,12 @@ class MatrixSdkDatabase extends DatabaseApi {
}
// Combine those two lists while respecting the start and limit parameters.
final eventIds = sendingEventIds + timelineEventIds;
// Create a new list object instead of concatonating list to prevent
// random type errors.
final eventIds = [
...sendingEventIds,
...timelineEventIds,
];
if (limit != null && eventIds.length > limit) {
eventIds.removeRange(limit, eventIds.length);
}