fix: Another type error when combining lists

This commit is contained in:
Krille 2024-01-12 16:24:00 +01:00
parent a7537462a4
commit 2afd7040a7
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
1 changed files with 5 additions and 4 deletions

View File

@ -428,10 +428,11 @@ class MatrixSdkDatabase extends DatabaseApi {
// Combine those two lists while respecting the start and limit parameters.
final end = min(timelineEventIds.length,
start + (limit ?? timelineEventIds.length));
final eventIds = sendingEventIds +
(start < timelineEventIds.length && !onlySending
? timelineEventIds.getRange(start, end).toList()
: []);
final eventIds = [
...sendingEventIds,
if (!onlySending && start < timelineEventIds.length)
...timelineEventIds.getRange(start, end),
];
return await _getEventsByIds(eventIds.cast<String>(), room);
});