mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-17 11:48:27 +00:00
Add deleted message bottom sheet when message is not retractable
This commit is contained in:
parent
068d2d2902
commit
83acef02d7
3 changed files with 10 additions and 5 deletions
|
|
@ -2,6 +2,6 @@ import Foundation
|
|||
|
||||
public enum AppGitInfo {
|
||||
public static let branch = "master"
|
||||
public static let commit = "1943f0f21"
|
||||
public static let commit = "068d2d290"
|
||||
public static let tag = "6.1.0-alpha"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ struct ConversationDeleteMessageBottomSheet: View {
|
|||
|
||||
@State private var orientation = UIDevice.current.orientation
|
||||
|
||||
@EnvironmentObject var conversationViewModel: ConversationViewModel
|
||||
|
||||
@Binding var showingSheet: Bool
|
||||
|
||||
var body: some View {
|
||||
|
|
@ -52,6 +54,7 @@ struct ConversationDeleteMessageBottomSheet: View {
|
|||
|
||||
Spacer()
|
||||
|
||||
|
||||
Button {
|
||||
NotificationCenter.default.post(name: NSNotification.Name("DeleteMessageForEveryone"), object: nil)
|
||||
|
||||
|
|
@ -71,10 +74,10 @@ struct ConversationDeleteMessageBottomSheet: View {
|
|||
Image("trash-simple")
|
||||
.renderingMode(.template)
|
||||
.resizable()
|
||||
.foregroundStyle(Color.redDanger500)
|
||||
.foregroundStyle(conversationViewModel.selectedMessage?.message.isRetractable == true ? Color.redDanger500 : Color.gray200)
|
||||
.frame(width: 25, height: 25, alignment: .leading)
|
||||
Text("conversation_dialog_delete_for_everyone_label")
|
||||
.foregroundStyle(Color.redDanger500)
|
||||
.foregroundStyle(conversationViewModel.selectedMessage?.message.isRetractable == true ? Color.redDanger500 : Color.gray200)
|
||||
.default_text_style(styleSize: 16)
|
||||
Spacer()
|
||||
}
|
||||
|
|
@ -82,6 +85,7 @@ struct ConversationDeleteMessageBottomSheet: View {
|
|||
}
|
||||
.padding(.horizontal, 30)
|
||||
.background(Color.gray100)
|
||||
.disabled(conversationViewModel.selectedMessage?.message.isRetractable == false)
|
||||
|
||||
VStack {
|
||||
Divider()
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ struct ConversationFragment: View {
|
|||
ConversationDeleteMessageBottomSheet(
|
||||
showingSheet: $isShowDeleteMessagePopup
|
||||
)
|
||||
.environmentObject(conversationViewModel)
|
||||
.presentationDetents([.fraction(0.15)])
|
||||
.ignoresSafeArea(.all)
|
||||
})
|
||||
|
|
@ -226,6 +227,7 @@ struct ConversationFragment: View {
|
|||
ConversationDeleteMessageBottomSheet(
|
||||
showingSheet: $isShowDeleteMessagePopup
|
||||
)
|
||||
.environmentObject(conversationViewModel)
|
||||
} onDismiss: {
|
||||
isShowDeleteMessagePopup = false
|
||||
}
|
||||
|
|
@ -1505,8 +1507,7 @@ struct ConversationFragment: View {
|
|||
|
||||
Button {
|
||||
if conversationViewModel.selectedMessage!.message.isOutgoing
|
||||
&& !(SharedMainViewModel.shared.displayedConversation?.isReadOnly ?? cachedConversation!.isReadOnly)
|
||||
&& conversationViewModel.selectedMessage!.message.isRetractable && !conversationViewModel.selectedMessage!.message.isRetracted {
|
||||
&& !(SharedMainViewModel.shared.displayedConversation?.isReadOnly ?? cachedConversation!.isReadOnly) && !conversationViewModel.selectedMessage!.message.isRetracted {
|
||||
isShowDeleteMessagePopup = true
|
||||
} else {
|
||||
conversationViewModel.deleteMessage()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue