From b608d59d8f55cb9454adcfd1243cad0429feb026 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sun, 30 Jul 2023 17:59:29 +0200 Subject: [PATCH] Omit footer when on-demand is disabled (#339) Preserve footer in that case, just empty. Adding/removing footer seems to result in a worse animation. --- Passepartout/App/Views/OnDemandView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Passepartout/App/Views/OnDemandView.swift b/Passepartout/App/Views/OnDemandView.swift index 49de2442..ce8c59bd 100644 --- a/Passepartout/App/Views/OnDemandView.swift +++ b/Passepartout/App/Views/OnDemandView.swift @@ -77,12 +77,15 @@ private extension OnDemandView { ) } } footer: { - Text(policyFooterDescription) + Text(policyFooterDescription ?? "") } } // FIXME: l10n, on-demand var policyFooterDescription: String { + guard onDemand.isEnabled else { + return "" // better animation than removing footer completely + } let suffix: String switch onDemand.policy { case .any: