From a6fc06aa1b8b7cb752e39393861282736a98ecd2 Mon Sep 17 00:00:00 2001 From: Leo Mehlig Date: Sun, 5 Jan 2025 01:45:07 +0100 Subject: [PATCH] Fix @Default triggering an extra redraw on appear (#195) --- Sources/Defaults/SwiftUI.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Defaults/SwiftUI.swift b/Sources/Defaults/SwiftUI.swift index 71941d7..3c9c2a0 100644 --- a/Sources/Defaults/SwiftUI.swift +++ b/Sources/Defaults/SwiftUI.swift @@ -39,7 +39,7 @@ extension Defaults { // The `@MainActor` is important as the `.send()` method doesn't inherit the `@MainActor` from the class. task = .detached(priority: .userInitiated) { @MainActor [weak self, key] in - for await _ in Defaults.updates(key) { + for await _ in Defaults.updates(key, initial: false) { guard let self else { return }