From dd1a4585e0f08045191a0455e2df71642eb9fb74 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 14 Aug 2024 20:19:20 +0200 Subject: [PATCH] Fix build on visionOS --- IceCubesApp/App/SafariRouter.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/IceCubesApp/App/SafariRouter.swift b/IceCubesApp/App/SafariRouter.swift index 9aac52ab..0cc3cd98 100644 --- a/IceCubesApp/App/SafariRouter.swift +++ b/IceCubesApp/App/SafariRouter.swift @@ -36,7 +36,9 @@ private struct SafariRouter: ViewModifier { // Open external URL (from icecubesapp://) guard !isSecondaryColumn else { return } if url.absoluteString == "icecubesapp://subclub" { + #if !os(visionOS) safariManager.dismiss() + #endif return } let urlString = url.absoluteString.replacingOccurrences(of: AppInfo.scheme, with: "https://") @@ -61,7 +63,12 @@ private struct SafariRouter: ViewModifier { .init(name: "callback", value: "icecubesapp://subclub"), .init(name: "id", value: "@\(accountName)") ]) + + #if !os(visionOS) return safariManager.open(newURL) + #else + return .systemAction + #endif } #if !targetEnvironment(macCatalyst) guard preferences.preferredBrowser == .inAppSafari else { return .systemAction }