Merge branch 'krille/set-read-marker-optional-eventid' into 'main'

refactor: Make optional eventId a named parameter

See merge request famedly/company/frontend/famedlysdk!1281
This commit is contained in:
Malin Errenst 2023-04-28 08:50:26 +00:00
commit a0669a505e
3 changed files with 3 additions and 3 deletions

View File

@ -363,7 +363,7 @@ class Timeline {
} }
/// Set the read marker to the last synced event in this timeline. /// Set the read marker to the last synced event in this timeline.
Future<void> setReadMarker(String? eventId, {bool? public}) async { Future<void> setReadMarker({String? eventId, bool? public}) async {
eventId ??= eventId ??=
events.firstWhereOrNull((event) => event.status.isSynced)?.eventId; events.firstWhereOrNull((event) => event.status.isSynced)?.eventId;
if (eventId == null) return; if (eventId == null) return;

View File

@ -480,7 +480,7 @@ void main() {
await waitForCount(7); await waitForCount(7);
room.notificationCount = 1; room.notificationCount = 1;
await timeline.setReadMarker(null); await timeline.setReadMarker();
//expect(room.notificationCount, 0); //expect(room.notificationCount, 0);
}); });
test('sending an event and the http request finishes first, 0 -> 1 -> 2', test('sending an event and the http request finishes first, 0 -> 1 -> 2',

View File

@ -706,7 +706,7 @@ void main() {
)); ));
await Future.delayed(Duration(milliseconds: 50)); await Future.delayed(Duration(milliseconds: 50));
room.notificationCount = 1; room.notificationCount = 1;
await timeline.setReadMarker(null); await timeline.setReadMarker();
//expect(room.notificationCount, 0); //expect(room.notificationCount, 0);
}); });
test('sending an event and the http request finishes first, 0 -> 1 -> 2', test('sending an event and the http request finishes first, 0 -> 1 -> 2',