diff --git a/apps/ios/Shared/Views/Chat/Group/GroupMentions.swift b/apps/ios/Shared/Views/Chat/Group/GroupMentions.swift index 4c3b2b2d29..958bbbabb2 100644 --- a/apps/ios/Shared/Views/Chat/Group/GroupMentions.swift +++ b/apps/ios/Shared/Views/Chat/Group/GroupMentions.swift @@ -130,7 +130,7 @@ struct GroupMentionsView: View { isVisible = true mentionName = name mentionRange = r - mentionMemberId = composeState.mentions[name]?.memberId + mentionMemberId = composeState.memberMentions[name] != nil ? composeState.mentions[name]?.memberId : nil if !m.membersLoaded { Task { await m.loadGroupMembers(groupInfo) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupMentions.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupMentions.kt index f0eb97f6e9..2a5f9df8c1 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupMentions.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupMentions.kt @@ -112,7 +112,7 @@ fun GroupMentions( isVisible.value = true mentionName.value = ft.format.memberName mentionRange.value = r - mentionMemberId.value = composeState.value.mentions[mentionName.value]?.memberId + mentionMemberId.value = if (mentionName.value in composeState.value.memberMentions) composeState.value.mentions[mentionName.value]?.memberId else null if (!chatModel.membersLoaded.value) { scope.launch { setGroupMembers(rhId, chatInfo.groupInfo, chatModel) @@ -210,7 +210,7 @@ fun GroupMentions( }, contentAlignment = Alignment.BottomStart ) { - val showMaxReachedBox = composeState.value.memberMentions.size >= MAX_NUMBER_OF_MENTIONS && isVisible.value && composeState.value.mentions[mentionName.value] == null + val showMaxReachedBox = composeState.value.memberMentions.size >= MAX_NUMBER_OF_MENTIONS && isVisible.value && mentionName.value !in composeState.value.memberMentions LazyColumnWithScrollBarNoAppBar( Modifier .heightIn(max = MAX_PICKER_HEIGHT)