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:
commit
a0669a505e
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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',
|
||||||
|
|
|
||||||
|
|
@ -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',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue