[Room] LastEvent calulcation fix
This commit is contained in:
parent
93b4efe004
commit
6d143241eb
|
@ -126,9 +126,12 @@ class Room {
|
||||||
|
|
||||||
Event get lastEvent {
|
Event get lastEvent {
|
||||||
ChatTime lastTime = ChatTime(0);
|
ChatTime lastTime = ChatTime(0);
|
||||||
Event lastEvent = null;
|
Event lastEvent = Event();
|
||||||
states.forEach((String key, RoomState value) {
|
states.forEach((String key, RoomState state) {
|
||||||
if (value.time > lastTime) lastEvent = value.timelineEvent;
|
if (state.time > lastTime) {
|
||||||
|
lastTime = state.time;
|
||||||
|
lastEvent = state.timelineEvent;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return lastEvent;
|
return lastEvent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue