Merge branch 'main' into develop
This commit is contained in:
commit
d3fc3791bc
|
@ -66,7 +66,9 @@ internal class RealmSendingEventsDataSource(
|
|||
|
||||
private fun updateFrozenResults(sendingEvents: RealmList<TimelineEventEntity>?) {
|
||||
// Makes sure to close the previous frozen realm
|
||||
if (frozenSendingTimelineEvents?.isValid == true) {
|
||||
frozenSendingTimelineEvents?.realm?.close()
|
||||
}
|
||||
frozenSendingTimelineEvents = sendingEvents?.freeze()
|
||||
}
|
||||
|
||||
|
@ -74,6 +76,7 @@ internal class RealmSendingEventsDataSource(
|
|||
val builtSendingEvents = mutableListOf<TimelineEvent>()
|
||||
uiEchoManager.getInMemorySendingEvents()
|
||||
.addWithUiEcho(builtSendingEvents)
|
||||
if (frozenSendingTimelineEvents?.isValid == true) {
|
||||
frozenSendingTimelineEvents
|
||||
?.filter { timelineEvent ->
|
||||
builtSendingEvents.none { it.eventId == timelineEvent.eventId }
|
||||
|
@ -81,6 +84,7 @@ internal class RealmSendingEventsDataSource(
|
|||
?.map {
|
||||
timelineEventMapper.map(it)
|
||||
}?.addWithUiEcho(builtSendingEvents)
|
||||
}
|
||||
|
||||
return builtSendingEvents
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue