From 4767f6deea9a9e63a19a5b96519fbd84307fbf95 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Wed, 23 Jul 2025 12:33:24 +0200 Subject: [PATCH] Display the deleteChatRoom option in the ConversationsList bottom sheet when the conversation is read-only --- .../ConversationsListBottomSheet.swift | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/Linphone/UI/Main/Conversations/Fragments/ConversationsListBottomSheet.swift b/Linphone/UI/Main/Conversations/Fragments/ConversationsListBottomSheet.swift index 3135794f2..e8b5cc040 100644 --- a/Linphone/UI/Main/Conversations/Fragments/ConversationsListBottomSheet.swift +++ b/Linphone/UI/Main/Conversations/Fragments/ConversationsListBottomSheet.swift @@ -239,8 +239,40 @@ struct ConversationsListBottomSheet: View { .frame(maxHeight: .infinity) } .padding(.horizontal, 30) - .background(Color.gray100) - } + .background(Color.gray100) + } + } else if let selectedConversation = conversationsListViewModel.selectedConversation, selectedConversation.isReadOnly { + Button { + selectedConversation.deleteChatRoom() + + if #available(iOS 16.0, *) { + if idiom != .pad { + showingSheet.toggle() + } else { + showingSheet.toggle() + dismiss() + } + } else { + showingSheet.toggle() + dismiss() + } + } label: { + HStack { + Image("trash-simple") + .renderingMode(.template) + .resizable() + .foregroundStyle(Color.redDanger500) + .frame(width: 25, height: 25, alignment: .leading) + .padding(.all, 10) + Text("conversation_action_delete") + .foregroundStyle(Color.redDanger500) + .default_text_style(styleSize: 16) + Spacer() + } + .frame(maxHeight: .infinity) + } + .padding(.horizontal, 30) + .background(Color.gray100) } } .background(Color.gray100)