mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Change Result/Failure logic to match new AccountError cases
This commit is contained in:
parent
a56da3c07b
commit
3384a972b0
@ -25,14 +25,16 @@ class AccountModel: ObservableObject {
|
||||
|
||||
if server != validServer {
|
||||
result = .failure(.serverNotFound)
|
||||
} else if username == validCredentials["username"] && password == validCredentials["password"] {
|
||||
} else if username != validCredentials["username"] {
|
||||
result = .failure(.usernameNotFound)
|
||||
} else if password != validCredentials["password"] {
|
||||
result = .failure(.invalidPassword)
|
||||
} else {
|
||||
self.id = UUID()
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.server = server
|
||||
result = .success(self.id!)
|
||||
} else {
|
||||
result = .failure(.invalidCredentials)
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user