Fix publishing changes from within view updates
All checks were successful
Deploy Docs / publish (push) Successful in 4m3s
SwiftLint / SwiftLint (push) Successful in 4s

This commit is contained in:
david-swift 2025-01-18 20:31:54 +01:00
parent 82fb4982ec
commit 319797a68d

View File

@ -102,7 +102,9 @@ extension SwiftUIWidget {
type: Data.Type
) where Data: ViewRenderData {
if updateProperties, let id = storage.fields["updater-id"] as? String {
SwiftUIUpdater.updater.state[id] = self
Task { @MainActor in
SwiftUIUpdater.updater.state[id] = self
}
}
var children = storage.fields["child-storages"] as? [String: ViewStorage] ?? [:]
for view in wrappedViews where !children.contains(where: { $0.key == view.key }) {