defaults move from .observe() to .updates()

https://github.com/sindresorhus/Defaults/releases/tag/v7.0.0
This commit is contained in:
Toni Förster 2023-12-27 17:27:24 +01:00
parent 0671b6ef9f
commit 36ecf63b6c
No known key found for this signature in database
GPG Key ID: 292F3E5086C83FC7

View File

@ -116,14 +116,14 @@ struct HomeView: View {
#endif
}
.onAppear {
Defaults.observe(.favorites) { _ in
favoritesChanged.toggle()
Task {
for await _ in Defaults.updates(.favorites) {
favoritesChanged.toggle()
}
for await _ in Defaults.updates(.widgetsSettings) {
favoritesChanged.toggle()
}
}
.tieToLifetime(of: accounts)
Defaults.observe(.widgetsSettings) { _ in
favoritesChanged.toggle()
}
.tieToLifetime(of: accounts)
}
.redrawOn(change: favoritesChanged)