File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
shared/src/commonMain/kotlin/dev/dimension/flare/ui Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,22 @@ import dev.dimension.flare.ui.render.toUi
2222import kotlinx.collections.immutable.toImmutableList
2323import kotlin.time.Instant
2424
25- internal fun DbPagingTimelineWithStatus.render (event : StatusEvent ? ): UiTimeline =
25+ internal fun DbPagingTimelineWithStatus.render (
26+ event : StatusEvent ? ,
27+ useDbKey : Boolean = false,
28+ ): UiTimeline =
2629 status.status.data.content
2730 .render(
2831 event,
2932 references =
3033 status.references.associate { it.reference.referenceType to it.status.data.content },
31- ).copy(dbKey = timeline._id )
34+ ).let {
35+ if (useDbKey) {
36+ it.copy(dbKey = timeline.accountType.toString())
37+ } else {
38+ it
39+ }
40+ }
3241
3342internal fun DbStatusWithReference.render (event : StatusEvent ? ): UiTimeline =
3443 status.data.content.render(
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ public class MixedTimelinePresenter(
1414) : TimelinePresenter(),
1515 KoinComponent {
1616 private val database: CacheDatabase by inject()
17+ override val useDbKeyInItemKey: Boolean = true
1718 override val loader: Flow <BaseTimelineLoader >
1819 get() =
1920 combine(subTimelinePresenter.map { it.loader }) {
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ public abstract class TimelinePresenter :
107107 }
108108 }
109109 }?.dataSource
110- data.render(dataSource)
110+ data.render(dataSource, useDbKeyInItemKey )
111111 }
112112 }
113113 }
@@ -155,6 +155,7 @@ public abstract class TimelinePresenter :
155155 }
156156
157157 internal abstract val loader: Flow <BaseTimelineLoader >
158+ protected open val useDbKeyInItemKey: Boolean = false
158159}
159160
160161@Immutable
You can’t perform that action at this time.
0 commit comments