diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/platform/RecAndPlay.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/platform/RecAndPlay.kt index be2c87a2f..bbc5cbe66 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/platform/RecAndPlay.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/platform/RecAndPlay.kt @@ -14,7 +14,7 @@ interface RecorderInterface { fun stop(): Int } -expect class RecorderNative: RecorderInterface +expect class RecorderNative(): RecorderInterface interface AudioPlayerInterface { fun play( diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt index fbe5746c6..57713a27a 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt @@ -105,7 +105,7 @@ fun ChatView(chatId: String, chatModel: ChatModel, onComposed: () -> Unit) { // Having activeChat reloaded on every change in it is inefficient (UI lags) val unreadCount = remember { derivedStateOf { - chatModel.chats.firstOrNull { chat -> chat.chatInfo.id == chatId }?.chatStats?.unreadCount ?: 0 + chatModel.chats.firstOrNull { chat -> chat.chatInfo.id == chatModel.chatId.value }?.chatStats?.unreadCount ?: 0 } } val clipboard = LocalClipboardManager.current @@ -974,17 +974,19 @@ fun BoxWithConstraintsScope.FloatingButtons( onLongClick = { showDropDown.value = true } ) - DefaultDropdownMenu(showDropDown, offset = DpOffset(maxWidth - DEFAULT_PADDING, 24.dp + fabSize)) { - ItemAction( - generalGetString(MR.strings.mark_read), - painterResource(MR.images.ic_check), - onClick = { - markRead( - CC.ItemRange(minUnreadItemId, chatItems[chatItems.size - listState.layoutInfo.visibleItemsInfo.lastIndex - 1].id - 1), - bottomUnreadCount - ) - showDropDown.value = false - }) + Box { + DefaultDropdownMenu(showDropDown, offset = DpOffset(this@FloatingButtons.maxWidth - DEFAULT_PADDING, 24.dp + fabSize)) { + ItemAction( + generalGetString(MR.strings.mark_read), + painterResource(MR.images.ic_check), + onClick = { + markRead( + CC.ItemRange(minUnreadItemId, chatItems[chatItems.size - listState.layoutInfo.visibleItemsInfo.lastIndex - 1].id - 1), + bottomUnreadCount + ) + showDropDown.value = false + }) + } } } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt index 4b305be29..3886fc8c2 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt @@ -104,7 +104,7 @@ fun ChatListNavLinkView(chat: Chat, chatModel: ChatModel) { fun directChatAction(chatInfo: ChatInfo, chatModel: ChatModel) { if (chatInfo.ready) { - withApi { openChat(chatInfo, chatModel) } + withBGApi { openChat(chatInfo, chatModel) } } else { pendingContactAlertDialog(chatInfo, chatModel) } @@ -114,7 +114,7 @@ fun groupChatAction(groupInfo: GroupInfo, chatModel: ChatModel) { when (groupInfo.membership.memberStatus) { GroupMemberStatus.MemInvited -> acceptGroupInvitationAlertDialog(groupInfo, chatModel) GroupMemberStatus.MemAccepted -> groupInvitationAcceptedAlert() - else -> withApi { openChat(ChatInfo.Group(groupInfo), chatModel) } + else -> withBGApi { openChat(ChatInfo.Group(groupInfo), chatModel) } } }