mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-25 01:31:04 +00:00
Allow cancel add account sheet even when no account
This commit is contained in:
parent
a737ac19e5
commit
56869e3a2f
1 changed files with 2 additions and 3 deletions
|
@ -88,9 +88,7 @@ struct AddAccountView: View {
|
||||||
.scrollDismissesKeyboard(.immediately)
|
.scrollDismissesKeyboard(.immediately)
|
||||||
#endif
|
#endif
|
||||||
.toolbar {
|
.toolbar {
|
||||||
if !appAccountsManager.availableAccounts.isEmpty {
|
CancelToolbarItem()
|
||||||
CancelToolbarItem()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
isInstanceURLFieldFocused = true
|
isInstanceURLFieldFocused = true
|
||||||
|
@ -290,6 +288,7 @@ struct AddAccountView: View {
|
||||||
let oauthToken = try await client.continueOauthFlow(url: url)
|
let oauthToken = try await client.continueOauthFlow(url: url)
|
||||||
let client = Client(server: client.server, oauthToken: oauthToken)
|
let client = Client(server: client.server, oauthToken: oauthToken)
|
||||||
let account: Account = try await client.get(endpoint: Accounts.verifyCredentials)
|
let account: Account = try await client.get(endpoint: Accounts.verifyCredentials)
|
||||||
|
Telemetry.signal("account.added")
|
||||||
appAccountsManager.add(account: AppAccount(server: client.server,
|
appAccountsManager.add(account: AppAccount(server: client.server,
|
||||||
accountName: "\(account.acct)@\(client.server)",
|
accountName: "\(account.acct)@\(client.server)",
|
||||||
oauthToken: oauthToken))
|
oauthToken: oauthToken))
|
||||||
|
|
Loading…
Reference in a new issue