|
|
|
|
@ -228,7 +228,8 @@ public class StoreCenter { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Returns whether the system has a user token |
|
|
|
|
public func hasToken() -> Bool { |
|
|
|
|
public var isAuthenticated: Bool { |
|
|
|
|
guard self.userId != nil else { return false } |
|
|
|
|
do { |
|
|
|
|
_ = try self.service().keychainStore.getValue() |
|
|
|
|
return true |
|
|
|
|
@ -485,8 +486,7 @@ public class StoreCenter { |
|
|
|
|
/// Basically asks the server for new content |
|
|
|
|
public func synchronizeLastUpdates() async throws { |
|
|
|
|
|
|
|
|
|
let hasToken = try? self.service().hasToken() |
|
|
|
|
guard hasToken == true else { |
|
|
|
|
guard self.isAuthenticated else { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|