mirror of
https://github.com/yattee/yattee.git
synced 2025-01-09 14:27:11 +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(\.colorScheme) private var colorScheme
|
||||||
@Environment(\.presentationMode) private var presentationMode
|
@Environment(\.presentationMode) private var presentationMode
|
||||||
|
|
||||||
|
@EnvironmentObject<AccountsModel> private var accounts
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Group {
|
Group {
|
||||||
@ -138,7 +140,12 @@ struct InstanceForm: View {
|
|||||||
return
|
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()
|
presentationMode.wrappedValue.dismiss()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user