contact sub status

This commit is contained in:
spaced4ndy
2025-10-13 12:55:27 +04:00
parent 72b20f9fb2
commit 50cf94beed
2 changed files with 17 additions and 7 deletions
@@ -56,6 +56,11 @@ struct ChatInfoToolbar: View {
.padding(.top, -2)
}
}
if let contact = chat.chatInfo.contact,
contact.ready && contact.active,
let chatSubStatus = ChatModel.shared.chatSubStatus {
SubStatusServerImage(status: chatSubStatus)
}
}
.foregroundColor(theme.colors.onBackground)
.frame(width: 220)
+12 -7
View File
@@ -556,16 +556,10 @@ struct ChatInfoView: View {
Spacer()
Text(status.statusString)
.foregroundColor(theme.colors.secondary)
serverImage(status)
SubStatusServerImage(status: status)
}
}
private func serverImage(_ status: SubscriptionStatus) -> some View {
return Image(systemName: status.imageName)
.foregroundColor(status == .active ? .green : theme.colors.secondary)
.font(.system(size: 12))
}
private func deleteContactButton() -> some View {
Button(role: .destructive) {
deleteContactDialog(
@@ -667,6 +661,17 @@ struct ChatInfoView: View {
}
}
struct SubStatusServerImage: View {
@EnvironmentObject var theme: AppTheme
var status: SubscriptionStatus
var body: some View {
Image(systemName: status.imageName)
.foregroundColor(status == .active ? .green : theme.colors.secondary)
.font(.system(size: 12))
}
}
struct ChatTTLOption: View {
@ObservedObject var chat: Chat
@Binding var progressIndicator: Bool