diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-12-05 13:22:23 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-12-05 16:05:10 +0100 |
| commit | 860ef43fa8c0bbf181a4059dc892ca2772746070 (patch) | |
| tree | fa02fd84ce2759d84e00ed10fd3a07a812ac2aaa /ios | |
| parent | 5bd2fc7dcf1e406156fc358c1fcd21932d113c52 (diff) | |
| download | mullvadvpn-860ef43fa8c0bbf181a4059dc892ca2772746070.tar.xz mullvadvpn-860ef43fa8c0bbf181a4059dc892ca2772746070.zip | |
Wire up Settings with the new Account facilities
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPN/SettingsViewController.swift | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/ios/MullvadVPN/SettingsViewController.swift b/ios/MullvadVPN/SettingsViewController.swift index 7a4ca8dc37..50273c39d9 100644 --- a/ios/MullvadVPN/SettingsViewController.swift +++ b/ios/MullvadVPN/SettingsViewController.swift @@ -18,14 +18,12 @@ class SettingsViewController: UITableViewController { case appVersion = "AppVersion" } - private var accountExpiryObserver: AccountExpiryRefresh.Observer? private weak var accountRow: StaticTableViewRow? override func viewDidLoad() { super.viewDidLoad() setupDataSource() - startAccountExpiryUpdates() } // MARK: - IBActions @@ -36,22 +34,13 @@ class SettingsViewController: UITableViewController { // MARK: - Private - private func startAccountExpiryUpdates() { - accountExpiryObserver = AccountExpiryRefresh.shared - .startMonitoringUpdates(with: { [weak self] (expiryDate) in - guard let self = self, let accountRow = self.accountRow else { return } - - self.staticDataSource.reloadRows([accountRow], with: .automatic) - }) - } - private func setupDataSource() { - if Account.isLoggedIn { + if Account.shared.isLoggedIn { let topSection = StaticTableViewSection() let accountRow = StaticTableViewRow(reuseIdentifier: CellIdentifier.account.rawValue) { (_, cell) in let cell = cell as! SettingsAccountCell - cell.accountExpiryDate = Account.expiry + cell.accountExpiryDate = Account.shared.expiry } self.accountRow = accountRow |
