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