mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-01 22:17:05 +01:00
fix: include post read property in item keys (#241)
This commit is contained in:
parent
4e7dbedb49
commit
b97351b011
@ -276,7 +276,9 @@ class InboxChatScreen(
|
||||
}
|
||||
items(
|
||||
items = uiState.messages,
|
||||
key = { it.id.toString() + (it.updateDate ?: it.publishDate) },
|
||||
key = {
|
||||
it.id.toString() + (it.updateDate ?: it.publishDate) + it.read
|
||||
},
|
||||
) { message ->
|
||||
val isMyMessage = message.creator?.id == uiState.currentUserId
|
||||
val content = message.content.orEmpty()
|
||||
|
@ -821,7 +821,9 @@ class CommunityDetailScreen(
|
||||
}
|
||||
items(
|
||||
items = uiState.posts,
|
||||
key = { it.id.toString() + (it.updateDate ?: it.publishDate) },
|
||||
key = {
|
||||
it.id.toString() + (it.updateDate ?: it.publishDate) + it.read
|
||||
},
|
||||
) { post ->
|
||||
LaunchedEffect(post.id) {
|
||||
if (settings.markAsReadWhileScrolling && !post.read) {
|
||||
|
@ -369,7 +369,7 @@ class FilteredContentsScreen(
|
||||
items(
|
||||
items = uiState.posts,
|
||||
key = {
|
||||
it.id.toString() + (it.updateDate ?: it.publishDate)
|
||||
it.id.toString() + (it.updateDate ?: it.publishDate) + it.read
|
||||
},
|
||||
) { post ->
|
||||
|
||||
@ -708,8 +708,8 @@ class FilteredContentsScreen(
|
||||
}
|
||||
}
|
||||
items(
|
||||
uiState.comments,
|
||||
{ it.id.toString() + (it.updateDate ?: it.publishDate) },
|
||||
items = uiState.comments,
|
||||
key = { it.id.toString() + (it.updateDate ?: it.publishDate) },
|
||||
) { comment ->
|
||||
|
||||
@Composable
|
||||
|
@ -110,7 +110,9 @@ class InboxMessagesScreen : Tab {
|
||||
items(
|
||||
items = uiState.chats,
|
||||
key = {
|
||||
it.id.toString() + (it.updateDate ?: it.publishDate) + it.read + uiState.unreadOnly
|
||||
it.id.toString() + (
|
||||
it.updateDate ?: it.publishDate
|
||||
) + it.read + uiState.unreadOnly
|
||||
},
|
||||
) { chat ->
|
||||
ChatCard(
|
||||
|
@ -281,7 +281,9 @@ class MultiCommunityScreen(
|
||||
}
|
||||
items(
|
||||
items = uiState.posts,
|
||||
key = { it.id.toString() + (it.updateDate ?: it.publishDate) },
|
||||
key = {
|
||||
it.id.toString() + (it.updateDate ?: it.publishDate) + it.read
|
||||
},
|
||||
) { post ->
|
||||
LaunchedEffect(post.id) {
|
||||
if (settings.markAsReadWhileScrolling && !post.read) {
|
||||
|
@ -276,7 +276,9 @@ object ProfileLoggedScreen : Tab {
|
||||
}
|
||||
items(
|
||||
items = uiState.posts,
|
||||
key = { it.id.toString() + (it.updateDate ?: it.publishDate) },
|
||||
key = {
|
||||
it.id.toString() + (it.updateDate ?: it.publishDate) + it.read
|
||||
},
|
||||
) { post ->
|
||||
PostCard(
|
||||
post = post,
|
||||
|
@ -360,9 +360,8 @@ class PostListScreen : Screen {
|
||||
// isLogged is added to the key to force swipe action refresh
|
||||
key = {
|
||||
it.id.toString() + (
|
||||
it.updateDate
|
||||
?: it.publishDate
|
||||
) + uiState.isLogged
|
||||
it.updateDate ?: it.publishDate
|
||||
) + it.read + uiState.isLogged
|
||||
},
|
||||
) { post ->
|
||||
LaunchedEffect(post.id) {
|
||||
|
@ -233,8 +233,7 @@ class ReportListScreen(
|
||||
items = uiState.postReports,
|
||||
key = {
|
||||
it.id.toString() + (
|
||||
it.updateDate
|
||||
?: it.publishDate
|
||||
it.updateDate ?: it.publishDate
|
||||
) + it.resolved + uiState.unresolvedOnly
|
||||
},
|
||||
) { report ->
|
||||
@ -346,8 +345,12 @@ class ReportListScreen(
|
||||
}
|
||||
}
|
||||
items(
|
||||
uiState.commentReports,
|
||||
{ it.id.toString() + (it.updateDate ?: it.publishDate) },
|
||||
items = uiState.commentReports,
|
||||
key = {
|
||||
it.id.toString() + (
|
||||
it.updateDate ?: it.publishDate
|
||||
) + it.resolved
|
||||
},
|
||||
) { report ->
|
||||
SwipeActionCard(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
@ -544,8 +544,10 @@ class UserDetailScreen(
|
||||
}
|
||||
}
|
||||
items(
|
||||
uiState.posts,
|
||||
{ it.id.toString() + (it.updateDate ?: it.publishDate) },
|
||||
items = uiState.posts,
|
||||
key = {
|
||||
it.id.toString() + (it.updateDate ?: it.publishDate) + it.read
|
||||
},
|
||||
) { post ->
|
||||
|
||||
@Composable
|
||||
|
Loading…
x
Reference in New Issue
Block a user