Marks as read regardless of note.event status.

This commit is contained in:
Vitor Pamplona
2023-02-27 15:19:24 -05:00
parent 7e3cfcdcaf
commit 4c916c7957
3 changed files with 4 additions and 10 deletions
@@ -47,7 +47,7 @@ fun BoostSetCompose(boostSetCard: BoostSetCard, isInnerNote: Boolean = false, ro
val noteEvent = note?.event
var popupExpanded by remember { mutableStateOf(false) }
if (note?.event == null) {
if (note == null) {
BlankNote(Modifier, isInnerNote)
} else {
var isNew by remember { mutableStateOf<Boolean>(false) }
@@ -55,9 +55,7 @@ fun BoostSetCompose(boostSetCard: BoostSetCard, isInnerNote: Boolean = false, ro
LaunchedEffect(key1 = boostSetCard) {
isNew = boostSetCard.createdAt > NotificationCache.load(routeForLastRead, context)
val createdAt = note.event?.createdAt
if (createdAt != null)
NotificationCache.markAsRead(routeForLastRead, boostSetCard.createdAt, context)
NotificationCache.markAsRead(routeForLastRead, boostSetCard.createdAt, context)
}
var backgroundColor = if (isNew) {
@@ -55,9 +55,7 @@ fun LikeSetCompose(likeSetCard: LikeSetCard, modifier: Modifier = Modifier, isIn
LaunchedEffect(key1 = likeSetCard) {
isNew = likeSetCard.createdAt > NotificationCache.load(routeForLastRead, context)
val createdAt = note.event?.createdAt
if (createdAt != null)
NotificationCache.markAsRead(routeForLastRead, likeSetCard.createdAt, context)
NotificationCache.markAsRead(routeForLastRead, likeSetCard.createdAt, context)
}
var backgroundColor = if (isNew) {
@@ -55,9 +55,7 @@ fun ZapSetCompose(zapSetCard: ZapSetCard, modifier: Modifier = Modifier, isInner
LaunchedEffect(key1 = zapSetCard) {
isNew = zapSetCard.createdAt > NotificationCache.load(routeForLastRead, context)
val createdAt = note.event?.createdAt
if (createdAt != null)
NotificationCache.markAsRead(routeForLastRead, zapSetCard.createdAt, context)
NotificationCache.markAsRead(routeForLastRead, zapSetCard.createdAt, context)
}
var backgroundColor = if (isNew) {