mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Replace environment objects with observed objects
This commit is contained in:
@@ -16,7 +16,7 @@ struct InstanceForm: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@Environment(\.presentationMode) private var presentationMode
|
||||
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
@@ -140,7 +140,7 @@ struct InstanceForm: View {
|
||||
return
|
||||
}
|
||||
|
||||
let savedInstance = InstancesModel.add(app: app, name: name, url: url)
|
||||
let savedInstance = InstancesModel.shared.add(app: app, name: name, url: url)
|
||||
savedInstanceID = savedInstance.id
|
||||
|
||||
if accounts.isEmpty {
|
||||
|
Reference in New Issue
Block a user