From 7423aba92a6b24a7cede5de9f83109348b31f202 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Sun, 11 Feb 2024 18:59:34 +0100 Subject: [PATCH] Fix crash on visionOS in AboutView --- IceCubesApp/App/Tabs/Settings/AboutView.swift | 2 +- .../Sources/AppAccount/AppAccountsSelectorView.swift | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/IceCubesApp/App/Tabs/Settings/AboutView.swift b/IceCubesApp/App/Tabs/Settings/AboutView.swift index 73199107..ed4d6304 100644 --- a/IceCubesApp/App/Tabs/Settings/AboutView.swift +++ b/IceCubesApp/App/Tabs/Settings/AboutView.swift @@ -27,7 +27,7 @@ struct AboutView: View { var body: some View { List { Section { - #if !targetEnvironment(macCatalyst) + #if !targetEnvironment(macCatalyst) && !os(visionOS) HStack { Spacer() Image(uiImage: .init(named: "AppIconAlternate0")!) diff --git a/Packages/AppAccount/Sources/AppAccount/AppAccountsSelectorView.swift b/Packages/AppAccount/Sources/AppAccount/AppAccountsSelectorView.swift index 67b975e4..f0d2d051 100644 --- a/Packages/AppAccount/Sources/AppAccount/AppAccountsSelectorView.swift +++ b/Packages/AppAccount/Sources/AppAccount/AppAccountsSelectorView.swift @@ -96,6 +96,9 @@ public struct AppAccountsSelectorView: View { AppAccountView(viewModel: viewModel, isParentPresented: $isPresented) } addAccountButton + #if os(visionOS) + .foregroundStyle(theme.labelColor) + #endif } #if !os(visionOS) .listRowBackground(theme.primaryBackgroundColor) @@ -107,8 +110,10 @@ public struct AppAccountsSelectorView: View { aboutButton supportButton } - #if !os(visionOS) - .listRowBackground(theme.primaryBackgroundColor) + #if os(visionOS) + .foregroundStyle(theme.labelColor) + #else + .listRowBackground(theme.primaryBackgroundColor) #endif } }