From 7c3a00a40d780d7689f909b0d0ce6c5d8b231254 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 16 Jun 2024 17:49:25 -0700 Subject: [PATCH] Fix compiling for visionOS --- Tusker/Screens/Announcements/AddReactionView.swift | 8 ++++++++ Tusker/Screens/Preferences/Tip Jar/TipJarView.swift | 1 + 2 files changed, 9 insertions(+) diff --git a/Tusker/Screens/Announcements/AddReactionView.swift b/Tusker/Screens/Announcements/AddReactionView.swift index 5bb8abffbd..f365ef1bee 100644 --- a/Tusker/Screens/Announcements/AddReactionView.swift +++ b/Tusker/Screens/Announcements/AddReactionView.swift @@ -64,9 +64,15 @@ struct AddReactionView: View { } .searchable(text: $query, placement: .navigationBarDrawer(displayMode: .always)) .searchPresentationToolbarBehaviorIfAvailable() + #if os(visionOS) + .onChange(of: query) { + updateFilteredEmojis() + } + #else .onChange(of: query) { _ in updateFilteredEmojis() } + #endif .navigationTitle("Add Reaction") .navigationBarTitleDisplayMode(.inline) .toolbar { @@ -166,6 +172,7 @@ private struct AddReactionButton: View { private extension View { @available(iOS, obsoleted: 16.0) + @available(visionOS 1.0, *) @ViewBuilder func mediumPresentationDetentIfAvailable() -> some View { if #available(iOS 16.0, *) { @@ -176,6 +183,7 @@ private extension View { } @available(iOS, obsoleted: 17.1) + @available(visionOS 1.0, *) @ViewBuilder func searchPresentationToolbarBehaviorIfAvailable() -> some View { if #available(iOS 17.1, *) { diff --git a/Tusker/Screens/Preferences/Tip Jar/TipJarView.swift b/Tusker/Screens/Preferences/Tip Jar/TipJarView.swift index f5b22bb276..6825cc5445 100644 --- a/Tusker/Screens/Preferences/Tip Jar/TipJarView.swift +++ b/Tusker/Screens/Preferences/Tip Jar/TipJarView.swift @@ -421,6 +421,7 @@ private class UbiquitousKeyValueStoreObserver: ObservableObject { private extension View { @available(iOS, obsoleted: 17.0) + @available(visionOS 1.0, *) @ViewBuilder func manageSubscriptionsSheetIfAvailable(isPresented: Binding, subscriptionGroupID: String) -> some View { if #available(iOS 17.0, *) {