|
|
|
|
@ -20,7 +20,6 @@ import LeStorage |
|
|
|
|
|
|
|
|
|
var updateListenerTask: Task<Void, Never>? = nil |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override init() { |
|
|
|
|
|
|
|
|
|
super.init() |
|
|
|
|
@ -34,10 +33,20 @@ import LeStorage |
|
|
|
|
Logger.error(error) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(collectionDidLoad), name: NSNotification.Name.CollectionDidLoad, object: nil) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
deinit { |
|
|
|
|
self.updateListenerTask?.cancel() |
|
|
|
|
NotificationCenter.default.removeObserver(self) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@objc func collectionDidLoad(notification: Notification) { |
|
|
|
|
if let _ = notification.object as? StoredCollection<Purchase> { |
|
|
|
|
self._updateBestPlan() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func productIds() async -> [String] { |
|
|
|
|
|