Using copy() on realm object when getting current poll history status

This commit is contained in:
Maxime NATUREL 2023-01-23 15:07:18 +01:00
parent cd1f41594d
commit 63026a3da5
1 changed files with 3 additions and 1 deletions

View File

@ -38,7 +38,9 @@ internal class DefaultGetLoadedPollsStatusTask @Inject constructor(
override suspend fun execute(params: GetLoadedPollsStatusTask.Params): LoadedPollsStatus {
return monarchy.awaitTransaction { realm ->
val status = PollHistoryStatusEntity.getOrCreate(realm, params.roomId)
val status = PollHistoryStatusEntity
.getOrCreate(realm, params.roomId)
.copy()
LoadedPollsStatus(
canLoadMore = status.isEndOfPollsBackward.not(),
nbSyncedDays = status.getNbSyncedDays(params.currentTimestampMs),