Skip to content

Commit 0f372bb

Browse files
committed
fix liquid glass build error
1 parent dbdfe6d commit 0f372bb

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

Core/CommonViewsKit/Sources/CommonViewsKit/Extensions/LiquidGlass+Extension.swift

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@
77

88
import SwiftUI
99

10-
public extension ToolbarContent {
11-
func disableSharedBackground() -> some ToolbarContent {
12-
if #available(macOS 26.0, *) {
13-
return self.sharedBackgroundVisibility(.hidden)
10+
struct RemoveSharedBackgroundWrapper<Content: ToolbarContent>: ToolbarContent {
11+
let content: Content
12+
13+
@ToolbarContentBuilder
14+
var body: some ToolbarContent {
15+
if #available(iOS 26, macOS 26, *) {
16+
content.sharedBackgroundVisibility(.hidden)
1417
} else {
15-
return self
18+
content
1619
}
1720
}
1821
}
22+
23+
public extension ToolbarContent {
24+
func disableSharedBackground() -> some ToolbarContent {
25+
RemoveSharedBackgroundWrapper(content: self)
26+
}
27+
}

0 commit comments

Comments
 (0)