Skip to content

Commit

Permalink
Disable NearbyDistance toolbar button on tvOS (bolsinga#751)
Browse files Browse the repository at this point in the history
- not just the popover.
  • Loading branch information
bolsinga authored Dec 5, 2023
1 parent 4bc42f0 commit cb192af
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Sources/Site/Music/UI/NearbyDistanceThresholdModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ struct NearbyDistanceThresholdModifier: ViewModifier {

func body(content: Content) -> some View {
content
.toolbar {
ToolbarItem(placement: .primaryAction) {
@Bindable var model = model
let labelText = Text("Nearby Distance", bundle: .module)
Button {
presentDistanceSliderPopover = true
} label: {
Label {
labelText
} icon: {
Image(systemName: "gear")
#if !os(tvOS)
.toolbar {
ToolbarItem(placement: .primaryAction) {
@Bindable var model = model
let labelText = Text("Nearby Distance", bundle: .module)
Button {
presentDistanceSliderPopover = true
} label: {
Label {
labelText
} icon: {
Image(systemName: "gear")
}
}
}
#if !os(tvOS)
.popover(isPresented: $presentDistanceSliderPopover) {
NearbyDistanceThresholdView(distanceThreshold: $model.distanceThreshold) {
labelText
}
.presentationCompactAdaptation(.popover)
}
#endif
}
}
}
#endif
.task {
model.distanceThreshold = nearbyDistanceThreshold
}
Expand Down

0 comments on commit cb192af

Please sign in to comment.