mirror of
https://github.com/yattee/yattee.git
synced 2025-01-08 22:07:10 +00:00
Use anonymous account after adding first instance
This commit is contained in:
parent
80d8d66986
commit
5d033cbdfc
@ -16,6 +16,8 @@ struct InstanceForm: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@Environment(\.presentationMode) private var presentationMode
|
||||
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
Group {
|
||||
@ -138,7 +140,12 @@ struct InstanceForm: View {
|
||||
return
|
||||
}
|
||||
|
||||
savedInstanceID = InstancesModel.add(app: app, name: name, url: url).id
|
||||
let savedInstance = InstancesModel.add(app: app, name: name, url: url)
|
||||
savedInstanceID = savedInstance.id
|
||||
|
||||
if accounts.isEmpty {
|
||||
accounts.setCurrent(savedInstance.anonymousAccount)
|
||||
}
|
||||
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user