mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-20 14:01:22 +02:00
Add LaunchedEffect key to fix pre-existing bug
This commit is contained in:
@@ -82,7 +82,7 @@ fun ChatroomCompose(baseNote: Note, accountViewModel: AccountViewModel, navContr
|
|||||||
channel?.let { channel ->
|
channel?.let { channel ->
|
||||||
var hasNewMessages by remember { mutableStateOf<Boolean>(false) }
|
var hasNewMessages by remember { mutableStateOf<Boolean>(false) }
|
||||||
|
|
||||||
LaunchedEffect(key1 = notificationCache) {
|
LaunchedEffect(key1 = notificationCache, key2 = note) {
|
||||||
note.createdAt()?.let {
|
note.createdAt()?.let {
|
||||||
hasNewMessages = it > notificationCache.cache.load("Channel/${channel.idHex}", context)
|
hasNewMessages = it > notificationCache.cache.load("Channel/${channel.idHex}", context)
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,7 @@ fun ChatroomCompose(baseNote: Note, accountViewModel: AccountViewModel, navContr
|
|||||||
userToComposeOn.let { user ->
|
userToComposeOn.let { user ->
|
||||||
var hasNewMessages by remember { mutableStateOf<Boolean>(false) }
|
var hasNewMessages by remember { mutableStateOf<Boolean>(false) }
|
||||||
|
|
||||||
LaunchedEffect(key1 = notificationCache) {
|
LaunchedEffect(key1 = notificationCache, key2 = note) {
|
||||||
noteEvent?.let {
|
noteEvent?.let {
|
||||||
hasNewMessages = it.createdAt > notificationCache.cache.load("Room/${userToComposeOn.pubkeyHex}", context)
|
hasNewMessages = it.createdAt > notificationCache.cache.load("Room/${userToComposeOn.pubkeyHex}", context)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user