Fixed add accounts

This commit is contained in:
Thomas Ricouard 2022-12-30 08:58:32 +01:00
parent 059fe3463b
commit e93e05872a
2 changed files with 1 additions and 3 deletions

View file

@ -34,8 +34,8 @@ class AppAccountsManager: ObservableObject {
func add(account: AppAccount) { func add(account: AppAccount) {
do { do {
try account.save() try account.save()
currentAccount = account
availableAccounts.append(account) availableAccounts.append(account)
currentAccount = account
} catch { } } catch { }
} }

View file

@ -126,8 +126,6 @@ struct AddAccountView: View {
do { do {
let oauthToken = try await client.continueOauthFlow(url: url) let oauthToken = try await client.continueOauthFlow(url: url)
appAccountsManager.add(account: AppAccount(server: client.server, oauthToken: oauthToken)) appAccountsManager.add(account: AppAccount(server: client.server, oauthToken: oauthToken))
await currentAccount.fetchCurrentAccount()
await currentInstance.fetchCurrentInstance()
isSigninIn = false isSigninIn = false
dismiss() dismiss()
} catch { } catch {