|
|
|
|
@ -54,7 +54,7 @@ class DataStore: ObservableObject { |
|
|
|
|
let serverURL: String = URLs.api.rawValue |
|
|
|
|
StoreCenter.main.blackListUserName("apple-test") |
|
|
|
|
|
|
|
|
|
#if _DEBUG_OPTIONS |
|
|
|
|
#if DEBUG |
|
|
|
|
if let server = PListReader.readString(plist: "local", key: "server") { |
|
|
|
|
StoreCenter.main.synchronizationApiURL = server |
|
|
|
|
} else { |
|
|
|
|
@ -70,7 +70,7 @@ class DataStore: ObservableObject { |
|
|
|
|
|
|
|
|
|
_ = Guard.main // init |
|
|
|
|
|
|
|
|
|
#if _DEBUG_OPTIONS |
|
|
|
|
#if DEBUG |
|
|
|
|
if let sync = PListReader.readBool(plist: "local", key: "synchronized") { |
|
|
|
|
synchronized = sync |
|
|
|
|
} |
|
|
|
|
@ -172,14 +172,9 @@ class DataStore: ObservableObject { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StoreCenter.main.disconnect() |
|
|
|
|
StoreCenter.main.collectionsCanSynchronize = false |
|
|
|
|
|
|
|
|
|
for tournament in self.tournaments { |
|
|
|
|
StoreCenter.main.destroyStore(identifier: tournament.id) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
self.tournaments.reset() |
|
|
|
|
self.clubs.reset() |
|
|
|
|
self.courts.reset() |
|
|
|
|
@ -187,6 +182,10 @@ class DataStore: ObservableObject { |
|
|
|
|
self.dateIntervals.reset() |
|
|
|
|
self.userStorage.reset() |
|
|
|
|
|
|
|
|
|
for tournament in self.tournaments { |
|
|
|
|
StoreCenter.main.destroyStore(identifier: tournament.id) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Guard.main.disconnect() |
|
|
|
|
|
|
|
|
|
self.user = self._temporaryLocalUser.item ?? User.placeHolder() |
|
|
|
|
|