mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 22:17:03 +05:30
refactor: lazily query saved and read state in UI
Having this always be read from the UI avoids values going stale inside data models Fixes #641
This commit is contained in:
parent
6f424ae2d5
commit
8651a4f66b
12 changed files with 56 additions and 100 deletions
|
@ -27,8 +27,6 @@ data class UIPost(
|
|||
@SerialName("submitter_user") val submitter: String,
|
||||
val tags: List<String>,
|
||||
val comments: List<Comment> = emptyList(),
|
||||
val isSaved: Boolean = false,
|
||||
val isRead: Boolean = false,
|
||||
val userIsAuthor: Boolean = false,
|
||||
) {
|
||||
@KonvertFrom(
|
||||
|
@ -37,7 +35,6 @@ data class UIPost(
|
|||
[
|
||||
Mapping(target = "submitter", expression = "it.submitterName"),
|
||||
Mapping(target = "commentCount", expression = "it.commentCount ?: 0"),
|
||||
Mapping(target = "isSaved", expression = "true"),
|
||||
],
|
||||
)
|
||||
companion object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue