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.
This commit is contained in:
Davide De Rosa 2023-07-30 17:59:29 +02:00 committed by GitHub
parent 388af4a73c
commit b608d59d8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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: