Skip to content

Commit

Permalink
Fix non-Darwin platform build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Jun 2, 2024
1 parent bb0761e commit d906b6b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// OpenSwiftUI
//
// Audited for RELEASE_2021
// Status: WIP
// Status: Blocked by _makeViewList
// ID: 8817D3B1C81ADA2B53E3500D727F785A

// MARK: - AppearanceActionModifier
Expand Down Expand Up @@ -79,6 +79,7 @@ extension AppearanceEffect: StatefulRule {
typealias Value = Void

mutating func updateValue() {
#if canImport(Darwin)
if node.attribute == nil {
node.attribute = .current

Check warning on line 84 in Sources/OpenSwiftUI/View/Modifier/AppearanceActionModifier.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenSwiftUI/View/Modifier/AppearanceActionModifier.swift#L81-L84

Added lines #L81 - L84 were not covered by tests
}
Expand All @@ -89,9 +90,14 @@ extension AppearanceEffect: StatefulRule {
}
lastValue = modifier
appeared()
#else
fatalError("See #39")
#endif

Check warning on line 95 in Sources/OpenSwiftUI/View/Modifier/AppearanceActionModifier.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenSwiftUI/View/Modifier/AppearanceActionModifier.swift#L91-L95

Added lines #L91 - L95 were not covered by tests
}
}

#if canImport(Darwin) // See #39

// MARK: AppearanceEffect + RemovableAttribute

extension AppearanceEffect: RemovableAttribute {
Expand All @@ -114,6 +120,7 @@ extension AppearanceEffect: RemovableAttribute {
nodeAttribute.graph.graphHost().graphInvalidation(from: nil)

Check warning on line 120 in Sources/OpenSwiftUI/View/Modifier/AppearanceActionModifier.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenSwiftUI/View/Modifier/AppearanceActionModifier.swift#L119-L120

Added lines #L119 - L120 were not covered by tests
}
}
#endif

// MARK: - View Extension

Expand Down

0 comments on commit d906b6b

Please sign in to comment.