Fixed the initialisation of the keychain storage in the GetUserUseCase use case
This commit is contained in:
parent
e9a7e8b33b
commit
3ecf5c7468
@ -95,7 +95,7 @@ private extension ContentView {
|
||||
do {
|
||||
user = try await getUser()
|
||||
} catch {
|
||||
// TODO: Handle this error appropriately.
|
||||
showSheet = .login
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,20 +14,18 @@ import KeychainStorage
|
||||
|
||||
public actor GetUserUseCase {
|
||||
|
||||
// MARK: Storages
|
||||
|
||||
@KeychainStorage(key: .KeychainStorage.account) var account: Account?
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
private let apiService: APIService
|
||||
|
||||
private var account: Account?
|
||||
|
||||
// MARK: Initialisers
|
||||
|
||||
public init(
|
||||
apiService: APIService,
|
||||
account: Account?
|
||||
) {
|
||||
public init(apiService: APIService) {
|
||||
self.apiService = apiService
|
||||
self.account = account
|
||||
}
|
||||
|
||||
// MARK: Functions
|
||||
@ -65,12 +63,8 @@ public actor GetUserUseCase {
|
||||
public extension GetUserUseCase {
|
||||
init() {
|
||||
@Dependency(\.apiService) var apiService
|
||||
@KeychainStorage(key: .KeychainStorage.account) var account: Account?
|
||||
|
||||
self.init(
|
||||
apiService: apiService,
|
||||
account: account
|
||||
)
|
||||
self.init(apiService: apiService)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user