diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2020-03-30 18:06:12 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2020-03-30 18:06:12 +0200 |
| commit | ac1f04493b4dcd7c313426b5188de8631390e7ef (patch) | |
| tree | 864306b50f4aea5daafab325ea53776b63739703 | |
| parent | 704f4d1d02d87d6f380eb3cb260143ac634627a1 (diff) | |
| parent | d8a72997ccafb0d8a3b659c138b9189d96309da7 (diff) | |
| download | mullvadvpn-ac1f04493b4dcd7c313426b5188de8631390e7ef.tar.xz mullvadvpn-ac1f04493b4dcd7c313426b5188de8631390e7ef.zip | |
Merge branch 'fix-outdated-expiry-label'
| -rw-r--r-- | ios/MullvadVPN/SettingsViewController.swift | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ios/MullvadVPN/SettingsViewController.swift b/ios/MullvadVPN/SettingsViewController.swift index ec280f92bf..e168e0a1b0 100644 --- a/ios/MullvadVPN/SettingsViewController.swift +++ b/ios/MullvadVPN/SettingsViewController.swift @@ -6,8 +6,9 @@ // Copyright © 2019 Mullvad VPN AB. All rights reserved. // -import UIKit +import Combine import Foundation +import UIKit class SettingsViewController: UITableViewController { @@ -20,10 +21,20 @@ class SettingsViewController: UITableViewController { } private weak var accountRow: StaticTableViewRow? + private var accountExpirySubscriber: AnyCancellable? override func viewDidLoad() { super.viewDidLoad() + accountExpirySubscriber = NotificationCenter.default + .publisher(for: Account.didUpdateAccountExpiryNotification, object: Account.shared) + .receive(on: DispatchQueue.main) + .sink { [weak self] (notification) in + guard let accountRow = self?.accountRow else { return } + + self?.staticDataSource.reloadRows([accountRow], with: .automatic) + } + setupDataSource() } |
