android, desktop: show the open chat's mute state in the chat menu

The mute item of the chat header menu kept the mute state it first saw:
after switching chats, such as opening a member's direct chat from a
group, it offered the previous chat's next mode, and it missed muting
done elsewhere, such as from the chat info.

Read the item's next mode from the chat's own setting.
This commit is contained in:
Narasimha-sc committed 2026-10-17 16:26:13 +00:00
1 parent 84b0cf5507
commit 25febe6d58
1 file changed
+1 -1
@@ -1356,7 +1356,7 @@ fun BoxScope.ChatInfoToolbar(
val enableNtfs = chatInfo.chatSettings?.enableNtfs
if (((chatInfo is ChatInfo.Direct && chatInfo.contact.ready && chatInfo.contact.active) || chatInfo is ChatInfo.Group) && enableNtfs != null) {
val ntfMode = remember { mutableStateOf(enableNtfs) }
val nextNtfMode by remember { derivedStateOf { ntfMode.value.nextMode(chatInfo.hasMentions) } }
val nextNtfMode = enableNtfs.nextMode(chatInfo.hasMentions)
menuItems.add {
ItemAction(
stringResource(nextNtfMode.text(chatInfo.hasMentions)),