Skip to content

Commit

Permalink
fixed invalid section (#89)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandr Chernyy <[email protected]>
  • Loading branch information
alexchornyi and pingus-nikalex authored Jul 22, 2021
1 parent 689a6e3 commit 176d5e7
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions Sources/Models/HCert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,11 @@ public struct HCert {
}

mutating func makeSectionsForVerifier(includeInvalidSection: Bool = true) {
info = isValid && includeInvalidSection ? [] : [
InfoSection(header: l10n("header.validity-errors"), content: validityFailures.joined(separator: " "))
]
if includeInvalidSection {
info = isValid ? [] : [
InfoSection(header: l10n("header.validity-errors"), content: validityFailures.joined(separator: " "))
]
}
if includeInvalidSection {
info += [
InfoSection(
Expand Down Expand Up @@ -349,9 +351,11 @@ public struct HCert {
}

mutating func makeSectionsForVaccine(includeInvalidSection: Bool = true) {
info = isValid && includeInvalidSection ? [] : [
InfoSection(header: l10n("header.validity-errors"), content: validityFailures.joined(separator: " "))
]
if includeInvalidSection {
info = isValid ? [] : [
InfoSection(header: l10n("header.validity-errors"), content: validityFailures.joined(separator: " "))
]
}
if includeInvalidSection {
info += [
InfoSection(
Expand Down Expand Up @@ -394,9 +398,11 @@ public struct HCert {
}

mutating func makeSectionsForTest(includeInvalidSection: Bool = true) {
info = isValid && includeInvalidSection ? [] : [
InfoSection(header: l10n("header.validity-errors"), content: validityFailures.joined(separator: " "))
]
if includeInvalidSection {
info = isValid ? [] : [
InfoSection(header: l10n("header.validity-errors"), content: validityFailures.joined(separator: " "))
]
}
if includeInvalidSection {
info += [
InfoSection(
Expand Down Expand Up @@ -439,9 +445,11 @@ public struct HCert {
}

mutating func makeSectionsForRecovery(includeInvalidSection: Bool = true) {
info = isValid && includeInvalidSection ? [] : [
if includeInvalidSection {
info = isValid ? [] : [
InfoSection(header: l10n("header.validity-errors"), content: validityFailures.joined(separator: " "))
]
]
}
if includeInvalidSection {
info += [
InfoSection(
Expand Down

0 comments on commit 176d5e7

Please sign in to comment.