fix: Type error when combining dynamic lists

This commit is contained in:
Krille 2024-01-04 08:30:00 +01:00
parent dbedaf9d79
commit 245cf59205
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
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);
}