From 45e64dc42c31bd72df01080b1c51ded14e84d278 Mon Sep 17 00:00:00 2001 From: Joel Klabo Date: Sun, 8 Jan 2023 21:48:29 -0800 Subject: [PATCH] Hide Recommended Relays Section if Empty Closes: #293 Changelog-Changed: Hide Recommended Relays Section if Empty --- damus/Views/ConfigView.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/damus/Views/ConfigView.swift b/damus/Views/ConfigView.swift index 4e913aab..d74cbeb0 100644 --- a/damus/Views/ConfigView.swift +++ b/damus/Views/ConfigView.swift @@ -70,9 +70,11 @@ struct ConfigView: View { } } - Section(NSLocalizedString("Recommended Relays", comment: "Section title for recommend relay servers that could be added as part of configuration")) { - List(recommended, id: \.url) { r in - RecommendedRelayView(damus: state, relay: r.url.absoluteString) + if recommended.count > 0 { + Section(NSLocalizedString("Recommended Relays", comment: "Section title for recommend relay servers that could be added as part of configuration")) { + List(recommended, id: \.url) { r in + RecommendedRelayView(damus: state, relay: r.url.absoluteString) + } } }