|
|
|
@ -59,8 +59,6 @@ class DataStore: ObservableObject { |
|
|
|
store.synchronizationApiURL = "https://xlr.alwaysdata.net/api/" |
|
|
|
store.synchronizationApiURL = "https://xlr.alwaysdata.net/api/" |
|
|
|
var synchronized : Bool = true |
|
|
|
var synchronized : Bool = true |
|
|
|
|
|
|
|
|
|
|
|
self.user = User.placeHolder() // force the didSet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DEBUG |
|
|
|
#if DEBUG |
|
|
|
if let server = PListReader.readString(plist: "local", key: "server") { |
|
|
|
if let server = PListReader.readString(plist: "local", key: "server") { |
|
|
|
store.synchronizationApiURL = server |
|
|
|
store.synchronizationApiURL = server |
|
|
|
@ -109,9 +107,7 @@ class DataStore: ObservableObject { |
|
|
|
@objc func collectionDidLoad(notification: Notification) { |
|
|
|
@objc func collectionDidLoad(notification: Notification) { |
|
|
|
self.objectWillChange.send() |
|
|
|
self.objectWillChange.send() |
|
|
|
if let userSingleton: StoredSingleton<User> = notification.object as? StoredSingleton<User> { |
|
|
|
if let userSingleton: StoredSingleton<User> = notification.object as? StoredSingleton<User> { |
|
|
|
Logger.log("StoredObject<User> loaded with user = \(String(describing: userSingleton.item()))") |
|
|
|
self.user = userSingleton.item() ?? self._temporaryLocalUser.item ?? User.placeHolder() |
|
|
|
|
|
|
|
|
|
|
|
self.user = userSingleton.item() ?? User.placeHolder() |
|
|
|
|
|
|
|
} else if let clubsCollection: StoredCollection<Club> = notification.object as? StoredCollection<Club> { |
|
|
|
} else if let clubsCollection: StoredCollection<Club> = notification.object as? StoredCollection<Club> { |
|
|
|
self._fixMissingClubCreatorIfNecessary(clubsCollection) |
|
|
|
self._fixMissingClubCreatorIfNecessary(clubsCollection) |
|
|
|
} else if let eventsCollection: StoredCollection<Event> = notification.object as? StoredCollection<Event> { |
|
|
|
} else if let eventsCollection: StoredCollection<Event> = notification.object as? StoredCollection<Event> { |
|
|
|
|