|
|
|
|
@ -98,7 +98,12 @@ class DataStore: ObservableObject { |
|
|
|
|
|
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(collectionDidLoad), name: NSNotification.Name.CollectionDidLoad, object: nil) |
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(collectionDidUpdate), name: NSNotification.Name.CollectionDidChange, object: nil) |
|
|
|
|
|
|
|
|
|
NotificationCenter.default.addObserver( |
|
|
|
|
self, |
|
|
|
|
selector: #selector(_willEnterForegroundNotification), |
|
|
|
|
name: UIScene.willEnterForegroundNotification, |
|
|
|
|
object: nil) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
deinit { |
|
|
|
|
@ -169,6 +174,12 @@ class DataStore: ObservableObject { |
|
|
|
|
self.objectWillChange.send() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@objc func _willEnterForegroundNotification() { |
|
|
|
|
Task { |
|
|
|
|
try await self.purchases.loadDataFromServerIfAllowed(clear: true) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func disconnect() { |
|
|
|
|
|
|
|
|
|
Task { |
|
|
|
|
|