Added connections

This commit is contained in:
Lumaa 2024-02-17 02:07:03 +01:00
parent 906cec2835
commit 4a5f8fd680
1 changed files with 4 additions and 0 deletions

View File

@ -227,6 +227,10 @@ struct AddInstanceView: View {
let client = Client(server: client.server, oauthToken: oauthToken)
let account: Account = try await client.get(endpoint: Accounts.verifyCredentials)
let appAcc = AppAccount(server: client.server, accountName: "\(account.acct)@\(client.server)", oauthToken: oauthToken)
let connections: [String] = try await client.get(endpoint: Instances.peers)
client.addConnections(connections)
appAcc.saveAsCurrent()
AccountManager.shared.setClient(client)
AccountManager.shared.setAccount(account)