mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Show 'Mark as read' option in bottom sheet when unreadMessagesCount > 0
This commit is contained in:
parent
992bd6c369
commit
a7e1a8b210
1 changed files with 31 additions and 29 deletions
|
|
@ -55,42 +55,44 @@ struct ConversationsListBottomSheet: View {
|
|||
Spacer()
|
||||
|
||||
if let selectedConversation = conversationsListViewModel.selectedConversation, !selectedConversation.isReadOnly {
|
||||
Button {
|
||||
conversationsListViewModel.markAsReadSelectedConversation()
|
||||
conversationsListViewModel.updateUnreadMessagesCount()
|
||||
|
||||
if #available(iOS 16.0, *) {
|
||||
if idiom != .pad {
|
||||
showingSheet.toggle()
|
||||
if selectedConversation.unreadMessagesCount > 0 {
|
||||
Button {
|
||||
conversationsListViewModel.markAsReadSelectedConversation()
|
||||
conversationsListViewModel.updateUnreadMessagesCount()
|
||||
|
||||
if #available(iOS 16.0, *) {
|
||||
if idiom != .pad {
|
||||
showingSheet.toggle()
|
||||
} else {
|
||||
showingSheet.toggle()
|
||||
dismiss()
|
||||
}
|
||||
} else {
|
||||
showingSheet.toggle()
|
||||
dismiss()
|
||||
}
|
||||
} else {
|
||||
showingSheet.toggle()
|
||||
dismiss()
|
||||
} label: {
|
||||
HStack {
|
||||
Image("envelope-simple")
|
||||
.renderingMode(.template)
|
||||
.resizable()
|
||||
.foregroundStyle(Color.grayMain2c500)
|
||||
.frame(width: 25, height: 25, alignment: .leading)
|
||||
.padding(.all, 10)
|
||||
Text("conversation_action_mark_as_read")
|
||||
.default_text_style(styleSize: 16)
|
||||
Spacer()
|
||||
}
|
||||
.frame(maxHeight: .infinity)
|
||||
}
|
||||
} label: {
|
||||
HStack {
|
||||
Image("envelope-simple")
|
||||
.renderingMode(.template)
|
||||
.resizable()
|
||||
.foregroundStyle(Color.grayMain2c500)
|
||||
.frame(width: 25, height: 25, alignment: .leading)
|
||||
.padding(.all, 10)
|
||||
Text("conversation_action_mark_as_read")
|
||||
.default_text_style(styleSize: 16)
|
||||
Spacer()
|
||||
.padding(.horizontal, 30)
|
||||
.background(Color.gray100)
|
||||
|
||||
VStack {
|
||||
Divider()
|
||||
}
|
||||
.frame(maxHeight: .infinity)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.padding(.horizontal, 30)
|
||||
.background(Color.gray100)
|
||||
|
||||
VStack {
|
||||
Divider()
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
Button {
|
||||
selectedConversation.toggleMute()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue