forked from mirrors/linphone-iphone
Fix displayed chat room mute menu
This commit is contained in:
parent
6336d4fae9
commit
d27ff560e9
1 changed files with 9 additions and 2 deletions
|
|
@ -35,6 +35,7 @@ struct ConversationFragment: View {
|
||||||
@ObservedObject var conversationForwardMessageViewModel: ConversationForwardMessageViewModel
|
@ObservedObject var conversationForwardMessageViewModel: ConversationForwardMessageViewModel
|
||||||
|
|
||||||
@State var isMenuOpen = false
|
@State var isMenuOpen = false
|
||||||
|
@State private var isMuted: Bool = false
|
||||||
|
|
||||||
@FocusState var isMessageTextFocused: Bool
|
@FocusState var isMessageTextFocused: Bool
|
||||||
|
|
||||||
|
|
@ -236,11 +237,13 @@ struct ConversationFragment: View {
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
isMenuOpen = false
|
isMenuOpen = false
|
||||||
|
conversationViewModel.displayedConversation!.toggleMute()
|
||||||
|
isMuted = !isMuted
|
||||||
} label: {
|
} label: {
|
||||||
HStack {
|
HStack {
|
||||||
Text(conversationViewModel.displayedConversation!.isMuted ? "conversation_action_unmute" : "conversation_action_mute")
|
Text(isMuted ? "conversation_action_unmute" : "conversation_action_mute")
|
||||||
Spacer()
|
Spacer()
|
||||||
Image(conversationViewModel.displayedConversation!.isMuted ? "bell-simple" : "bell-simple-slash")
|
Image(isMuted ? "bell-simple" : "bell-simple-slash")
|
||||||
.renderingMode(.template)
|
.renderingMode(.template)
|
||||||
.resizable()
|
.resizable()
|
||||||
.foregroundStyle(Color.grayMain2c500)
|
.foregroundStyle(Color.grayMain2c500)
|
||||||
|
|
@ -271,6 +274,10 @@ struct ConversationFragment: View {
|
||||||
.frame(width: 25, height: 25, alignment: .leading)
|
.frame(width: 25, height: 25, alignment: .leading)
|
||||||
.padding(.all, 10)
|
.padding(.all, 10)
|
||||||
.padding(.top, 4)
|
.padding(.top, 4)
|
||||||
|
.onChange(of: isMuted) { _ in }
|
||||||
|
.onAppear {
|
||||||
|
isMuted = conversationViewModel.displayedConversation!.isMuted
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
isMenuOpen = true
|
isMenuOpen = true
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue