mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 03:48:12 +03:00
Using copy() on realm object when getting current poll history status
This commit is contained in:
parent
cd1f41594d
commit
63026a3da5
1 changed files with 3 additions and 1 deletions
|
@ -38,7 +38,9 @@ internal class DefaultGetLoadedPollsStatusTask @Inject constructor(
|
||||||
|
|
||||||
override suspend fun execute(params: GetLoadedPollsStatusTask.Params): LoadedPollsStatus {
|
override suspend fun execute(params: GetLoadedPollsStatusTask.Params): LoadedPollsStatus {
|
||||||
return monarchy.awaitTransaction { realm ->
|
return monarchy.awaitTransaction { realm ->
|
||||||
val status = PollHistoryStatusEntity.getOrCreate(realm, params.roomId)
|
val status = PollHistoryStatusEntity
|
||||||
|
.getOrCreate(realm, params.roomId)
|
||||||
|
.copy()
|
||||||
LoadedPollsStatus(
|
LoadedPollsStatus(
|
||||||
canLoadMore = status.isEndOfPollsBackward.not(),
|
canLoadMore = status.isEndOfPollsBackward.not(),
|
||||||
nbSyncedDays = status.getNbSyncedDays(params.currentTimestampMs),
|
nbSyncedDays = status.getNbSyncedDays(params.currentTimestampMs),
|
||||||
|
|
Loading…
Reference in a new issue