mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-25 22:52:12 +00:00
ui: disable swipe to reply, context menu reply when user can't send (#6822)
This commit is contained in:
@@ -2108,7 +2108,7 @@ struct ChatView: View {
|
||||
func chatItemWithMenu(_ ci: ChatItem, _ range: ClosedRange<Int>?, _ maxWidth: CGFloat, _ itemSeparation: ItemSeparation) -> some View {
|
||||
let alignment: Alignment = ci.chatDir.sent ? .trailing : .leading
|
||||
let live = composeState.liveMessage != nil
|
||||
let canReply = ci.meta.itemDeleted == nil && !ci.isLiveDummy && !live && !ci.localNote && selectedChatItems == nil
|
||||
let canReply = ci.meta.itemDeleted == nil && !ci.isLiveDummy && !live && !ci.localNote && selectedChatItems == nil && chat.chatInfo.sendMsgEnabled
|
||||
return ZStack(alignment: .trailing) {
|
||||
Image(systemName: "arrowshape.turn.up.left")
|
||||
.font(.system(size: 18))
|
||||
@@ -2276,7 +2276,7 @@ struct ChatView: View {
|
||||
availableReactions.count > 0 {
|
||||
reactionsGroup
|
||||
}
|
||||
if ci.meta.itemDeleted == nil && !ci.isLiveDummy && !live && !ci.localNote {
|
||||
if ci.meta.itemDeleted == nil && !ci.isLiveDummy && !live && !ci.localNote && chat.chatInfo.sendMsgEnabled {
|
||||
replyButton
|
||||
}
|
||||
let fileSource = getLoadedFileSource(ci.file)
|
||||
|
||||
@@ -1953,7 +1953,7 @@ fun BoxScope.ChatItemsList(
|
||||
}
|
||||
false
|
||||
}
|
||||
val swipeableModifier = if (appPlatform.isDesktop) Modifier else SwipeToDismissModifier(
|
||||
val swipeableModifier = if (appPlatform.isDesktop || !chatInfo.sendMsgEnabled) Modifier else SwipeToDismissModifier(
|
||||
state = dismissState,
|
||||
directions = setOf(DismissDirection.EndToStart),
|
||||
swipeDistance = with(LocalDensity.current) { 30.dp.toPx() },
|
||||
|
||||
@@ -402,7 +402,7 @@ fun ChatItemView(
|
||||
if (cInfo.featureEnabled(ChatFeature.Reactions) && cItem.allowAddReaction) {
|
||||
MsgReactionsMenu()
|
||||
}
|
||||
if (cItem.meta.itemDeleted == null && !live && !cItem.localNote) {
|
||||
if (cItem.meta.itemDeleted == null && !live && !cItem.localNote && cInfo.sendMsgEnabled) {
|
||||
ItemAction(stringResource(MR.strings.reply_verb), painterResource(MR.images.ic_reply), onClick = {
|
||||
if (composeState.value.editing) {
|
||||
composeState.value = ComposeState(contextItem = ComposeContextItem.QuotedItem(cItem), useLinkPreviews = useLinkPreviews)
|
||||
|
||||
Reference in New Issue
Block a user