From 36ecf63b6c88ff025d6f86bdd257020ce9098977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20F=C3=B6rster?= Date: Wed, 27 Dec 2023 17:27:24 +0100 Subject: [PATCH] defaults move from .observe() to .updates() https://github.com/sindresorhus/Defaults/releases/tag/v7.0.0 --- Shared/Home/HomeView.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Shared/Home/HomeView.swift b/Shared/Home/HomeView.swift index 308b58e7..19822d0a 100644 --- a/Shared/Home/HomeView.swift +++ b/Shared/Home/HomeView.swift @@ -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)