diff --git a/Passepartout-iOS/Global/ProductManager.swift b/Passepartout-iOS/Global/ProductManager.swift index 84afba98..9ff50308 100644 --- a/Passepartout-iOS/Global/ProductManager.swift +++ b/Passepartout-iOS/Global/ProductManager.swift @@ -34,6 +34,8 @@ private let log = SwiftyBeaver.self class ProductManager: NSObject { static let didReloadReceipt = Notification.Name("ProductManagerDidReloadReceipt") + + static let didReviewPurchases = Notification.Name("ProductManagerDidReviewPurchases") private static let lastFullVersionBuild = 2016 // 1.8.1 @@ -223,7 +225,7 @@ class ProductManager: NSObject { TransientStore.shared.serialize(withProfiles: true) VPN.shared.uninstall(completionHandler: nil) - NotificationCenter.default.post(name: ProductManager.didReloadReceipt, object: nil) + NotificationCenter.default.post(name: ProductManager.didReviewPurchases, object: nil) } } diff --git a/Passepartout-iOS/Scenes/ServiceViewController.swift b/Passepartout-iOS/Scenes/ServiceViewController.swift index ad38ac2d..5b11bdfa 100644 --- a/Passepartout-iOS/Scenes/ServiceViewController.swift +++ b/Passepartout-iOS/Scenes/ServiceViewController.swift @@ -120,6 +120,7 @@ class ServiceViewController: UIViewController, StrongTableHost { } nc.addObserver(self, selector: #selector(serviceDidUpdateDataCount(_:)), name: ConnectionService.didUpdateDataCount, object: nil) nc.addObserver(self, selector: #selector(productManagerDidReloadReceipt), name: ProductManager.didReloadReceipt, object: nil) + nc.addObserver(self, selector: #selector(productManagerDidReviewPurchases), name: ProductManager.didReviewPurchases, object: nil) // run this no matter what // XXX: convenient here vs AppDelegate for updating table @@ -141,6 +142,7 @@ class ServiceViewController: UIViewController, StrongTableHost { super.viewDidAppear(animated) clearSelection() + hideProfileIfDeleted() } override func didReceiveMemoryWarning() { @@ -674,6 +676,10 @@ class ServiceViewController: UIViewController, StrongTableHost { reloadModel() tableView.reloadData() } + + @objc private func productManagerDidReviewPurchases() { + hideProfileIfDeleted() + } } // MARK: -