From 430dc5bd2eebb3b97ba4df88edeec3d64abf6748 Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Fri, 26 Jan 2024 00:48:40 +0700 Subject: [PATCH] ui: don't show context menu on non-sent yet live message (#3754) * android, desktop: don't show context menu on non-sent yet live message * ios: don't show context menu on non-sent yet live message --------- Co-authored-by: Avently --- apps/ios/Shared/Views/Chat/ChatView.swift | 4 +++- .../chat/simplex/common/views/chat/item/ChatItemView.kt | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index 0915d6287..35caf655e 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -749,7 +749,9 @@ struct ChatView: View { if ci.meta.editable && !mc.isVoice && !live { menu.append(editAction(ci)) } - menu.append(viewInfoUIAction(ci)) + if !ci.isLiveDummy { + menu.append(viewInfoUIAction(ci)) + } if revealed { menu.append(hideUIAction()) } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/ChatItemView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/ChatItemView.kt index 93d5430a2..354f6b136 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/ChatItemView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/ChatItemView.kt @@ -177,7 +177,8 @@ fun ChatItemView( fun MsgContentItemDropdownMenu() { val saveFileLauncher = rememberSaveFileLauncher(ciFile = cItem.file) when { - cItem.content.msgContent != null -> { + // cItem.id check is a special case for live message chat item which has negative ID while not sent yet + cItem.content.msgContent != null && cItem.id >= 0 -> { DefaultDropdownMenu(showMenu) { if (cInfo.featureEnabled(ChatFeature.Reactions) && cItem.allowAddReaction) { MsgReactionsMenu()