Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Fix/14950 Update homescreen when app becomes active #5096

17 changes: 7 additions & 10 deletions src/xcode/ENA/ENA/Source/Scenes/Home/HomeTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,16 @@ class HomeTableViewController: UITableViewController, NavigationBarOpacityDelega
viewModel.cclService.shouldShowNoticeTile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this deletion we would ignore the CCL config for App Closure Notice. I know it makes sense, because we show either the notice or the thank-you tile. But is it aligned with the Tech Spec?

.receive(on: DispatchQueue.OCombine(.main))
.sink { [weak self] shouldShowNoticeTile in
let isHibernationState = CWAHibernationProvider.shared.isHibernationState
self?.viewModel.isHibernationState = isHibernationState
self?.viewModel.shouldShowAppClosureNotice = shouldShowNoticeTile
self?.tableView.reloadSections(
[
HomeTableViewModel.Section.appClosureNotice.rawValue,
HomeTableViewModel.Section.endOfLifeThankYou.rawValue,
HomeTableViewModel.Section.exposureLogging.rawValue,
HomeTableViewModel.Section.riskAndTestResults.rawValue,
HomeTableViewModel.Section.statistics.rawValue,
HomeTableViewModel.Section.testRegistration.rawValue,
HomeTableViewModel.Section.traceLocations.rawValue,
HomeTableViewModel.Section.moreInfo.rawValue
HomeTableViewModel.Section.appClosureNotice.rawValue
],
with: .none
)
}
.store(in: &subscriptions)

}

@available(*, unavailable)
Expand Down Expand Up @@ -1134,6 +1126,11 @@ class HomeTableViewController: UITableViewController, NavigationBarOpacityDelega
@objc
private func onDidBecomeActiveNotification() {
setupRightBarButtonItem()

viewModel.isHibernationState = CWAHibernationProvider.shared.isHibernationState
DispatchQueue.main.async { [weak self] in
self?.tableView.reloadData()
}
}

// swiftlint:disable:next file_length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class HomeTableViewModelTests: CWATestCase {
// Is hibernation and should show app closure notice
sut.isHibernationState = true
sut.shouldShowAppClosureNotice = true

// THEN

// Number of Sections
Expand Down