diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index 6651b7cc5a..5500b0c6e7 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -183,7 +183,7 @@ struct ChatView: View { .disabled(!contact.ready || !contact.active) } searchButton() - toggleNtfsButton(chat) + ToggleNtfsButton(chat: chat) .disabled(!contact.ready || !contact.active) } label: { Image(systemName: "ellipsis") @@ -212,7 +212,7 @@ struct ChatView: View { } Menu { searchButton() - toggleNtfsButton(chat) + ToggleNtfsButton(chat: chat) } label: { Image(systemName: "ellipsis") } @@ -1198,14 +1198,18 @@ struct ChatView: View { } } -@ViewBuilder func toggleNtfsButton(_ chat: Chat) -> some View { - Button { - toggleNotifications(chat, enableNtfs: !chat.chatInfo.ntfsEnabled) - } label: { - if chat.chatInfo.ntfsEnabled { - Label("Mute", systemImage: "speaker.slash") - } else { - Label("Unmute", systemImage: "speaker.wave.2") +struct ToggleNtfsButton: View { + @ObservedObject var chat: Chat + + var body: some View { + Button { + toggleNotifications(chat, enableNtfs: !chat.chatInfo.ntfsEnabled) + } label: { + if chat.chatInfo.ntfsEnabled { + Label("Mute", systemImage: "speaker.slash") + } else { + Label("Unmute", systemImage: "speaker.wave.2") + } } } } diff --git a/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift b/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift index 7fbc1e4ac8..efe254323e 100644 --- a/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift +++ b/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift @@ -92,7 +92,7 @@ struct ChatListNavLink: View { .swipeActions(edge: .leading, allowsFullSwipe: true) { markReadButton() toggleFavoriteButton() - toggleNtfsButton(chat) + ToggleNtfsButton(chat: chat) } .swipeActions(edge: .trailing, allowsFullSwipe: true) { if !chat.chatItems.isEmpty { @@ -181,7 +181,7 @@ struct ChatListNavLink: View { .swipeActions(edge: .leading, allowsFullSwipe: true) { markReadButton() toggleFavoriteButton() - toggleNtfsButton(chat) + ToggleNtfsButton(chat: chat) } .swipeActions(edge: .trailing, allowsFullSwipe: true) { if !chat.chatItems.isEmpty {