fix(macos): colorize provider status subtitles

This commit is contained in:
Peter Steinberger
2026-01-01 23:16:22 +01:00
parent f0da42917b
commit 279a191b86

View File

@@ -321,26 +321,30 @@ struct ConnectionsSettings: View {
private var whatsAppTint: Color { private var whatsAppTint: Color {
guard let status = self.store.snapshot?.whatsapp else { return .secondary } guard let status = self.store.snapshot?.whatsapp else { return .secondary }
if !status.configured { return .secondary }
if !status.linked { return .red } if !status.linked { return .red }
if status.connected { return .green }
if status.lastError != nil { return .orange } if status.lastError != nil { return .orange }
return .green if status.connected { return .green }
if status.running { return .orange }
return .orange
} }
private var telegramTint: Color { private var telegramTint: Color {
guard let status = self.store.snapshot?.telegram else { return .secondary } guard let status = self.store.snapshot?.telegram else { return .secondary }
if !status.configured { return .secondary } if !status.configured { return .secondary }
if status.running { return .green }
if status.lastError != nil { return .orange } if status.lastError != nil { return .orange }
return .secondary if status.probe?.ok == false { return .orange }
if status.running { return .green }
return .orange
} }
private var discordTint: Color { private var discordTint: Color {
guard let status = self.store.snapshot?.discord else { return .secondary } guard let status = self.store.snapshot?.discord else { return .secondary }
if !status.configured { return .secondary } if !status.configured { return .secondary }
if status.running { return .green }
if status.lastError != nil { return .orange } if status.lastError != nil { return .orange }
return .secondary if status.probe?.ok == false { return .orange }
if status.running { return .green }
return .orange
} }
private var whatsAppSummary: String { private var whatsAppSummary: String {
@@ -472,7 +476,7 @@ struct ConnectionsSettings: View {
.font(.headline) .font(.headline)
Text(subtitle) Text(subtitle)
.font(.caption) .font(.caption)
.foregroundStyle(.secondary) .foregroundStyle(color)
} }
Spacer() Spacer()
} }