mirror of
https://github.com/yattee/yattee.git
synced 2025-10-15 03:48:11 +00:00
Replace environment objects with observed objects
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import SwiftUI
|
||||
|
||||
struct AccountsNavigationLink: View {
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
var instance: Instance
|
||||
|
||||
var body: some View {
|
||||
@@ -30,6 +30,6 @@ struct AccountsNavigationLink: View {
|
||||
if accounts.current?.instance == instance {
|
||||
accounts.setCurrent(nil)
|
||||
}
|
||||
InstancesModel.remove(instance)
|
||||
InstancesModel.shared.remove(instance)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user