From b665dce383d97c0f15671b9a9af6e08f32ec90b9 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Thu, 23 Mar 2023 23:09:37 +0000 Subject: [PATCH] ios: show muted user profiles in user menu, do not show badge on messages in hidden profiles (#2068) --- apps/ios/Shared/Views/ChatList/ChatListView.swift | 2 +- apps/ios/Shared/Views/ChatList/UserPicker.swift | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/ios/Shared/Views/ChatList/ChatListView.swift b/apps/ios/Shared/Views/ChatList/ChatListView.swift index d23418101f..0b2a3f1a9e 100644 --- a/apps/ios/Shared/Views/ChatList/ChatListView.swift +++ b/apps/ios/Shared/Views/ChatList/ChatListView.swift @@ -85,7 +85,7 @@ struct ChatListView: View { .frame(width: 32, height: 32) .padding(.trailing, 4) let allRead = chatModel.users - .filter { !$0.user.activeUser } + .filter { u in !u.user.activeUser && !u.user.hidden } .allSatisfy { u in u.unreadCount == 0 } if !allRead { unreadBadge(size: 12) diff --git a/apps/ios/Shared/Views/ChatList/UserPicker.swift b/apps/ios/Shared/Views/ChatList/UserPicker.swift index 76bac7a28c..bb88f5c382 100644 --- a/apps/ios/Shared/Views/ChatList/UserPicker.swift +++ b/apps/ios/Shared/Views/ChatList/UserPicker.swift @@ -126,7 +126,9 @@ struct UserPicker: View { if user.activeUser { Image(systemName: "checkmark") } else if u.unreadCount > 0 { - unreadCounter(u.unreadCount) + unreadCounter(u.unreadCount, color: user.showNtfs ? .accentColor : .secondary) + } else if !user.showNtfs { + Image(systemName: "speaker.slash") } } .padding(.trailing) @@ -152,13 +154,13 @@ struct UserPicker: View { } } -func unreadCounter(_ unread: Int) -> some View { +private func unreadCounter(_ unread: Int, color: Color) -> some View { unreadCountText(unread) .font(.caption) .foregroundColor(.white) .padding(.horizontal, 4) .frame(minWidth: 18, minHeight: 18) - .background(Color.accentColor) + .background(color) .cornerRadius(10) }