diff --git a/PlayCover/View/AppsView.swift b/PlayCover/View/AppsView.swift index a4bb1d11..c151bef6 100644 --- a/PlayCover/View/AppsView.swift +++ b/PlayCover/View/AppsView.swift @@ -11,19 +11,15 @@ import AppKit struct AppsView: View { @Binding public var bottomPadding: CGFloat + @Binding public var xcodeCliInstalled: Bool @EnvironmentObject var appVm: AppsVM @State private var gridLayout = [GridItem(.adaptive(minimum: 150, maximum: 150), spacing: 0)] - @State private var alertTitle = "" - @State private var alertText = "" - @State private var alertBtn = "" - @State private var alertAction : (() -> Void) = {} - @State private var showAlert = false var body: some View { @@ -31,7 +27,7 @@ struct AppsView: View { HStack { SearchView().padding(.horizontal, 20).padding(.vertical, 8) } - if !shell.isXcodeCliToolsInstalled { + if !xcodeCliInstalled { VStack(spacing: 12) { Text("You need to install Xcode Commandline tools and restart this App.") .font(.title3) diff --git a/PlayCover/View/MainView.swift b/PlayCover/View/MainView.swift index 097b711d..99b24103 100644 --- a/PlayCover/View/MainView.swift +++ b/PlayCover/View/MainView.swift @@ -68,11 +68,12 @@ struct MainView: View { @State var bottomHeight: CGFloat = 0 @Binding var showToast: Bool + @Binding public var xcodeCliInstalled: Bool var body: some View { if apps.updatingApps { ProgressView() } else { ZStack(alignment: .bottom) { - AppsView(bottomPadding: $bottomHeight) + AppsView(bottomPadding: $bottomHeight, xcodeCliInstalled: $xcodeCliInstalled) .frame(maxWidth: .infinity, maxHeight: .infinity).environmentObject(AppsVM.shared) VStack(alignment: .leading, spacing: 0) { @@ -155,8 +156,9 @@ struct MainView: View { struct Previews_MainView_Previews: PreviewProvider { @State static var showToast = false + @State static var xcodeCliInstalled = true static var previews: some View { - MainView(showToast: $showToast) + MainView(showToast: $showToast, xcodeCliInstalled: $xcodeCliInstalled) .padding() .environmentObject(InstallVM.shared) .environmentObject(AppsVM.shared) diff --git a/PlayCover/View/PlayCoverApp.swift b/PlayCover/View/PlayCoverApp.swift index c0ab7da0..7f5b5110 100644 --- a/PlayCover/View/PlayCoverApp.swift +++ b/PlayCover/View/PlayCoverApp.swift @@ -41,10 +41,11 @@ struct PlayCoverApp: App { @StateObject var updaterViewModel = UpdaterViewModel() @State var showToast = false + @State var xcodeCliInstalled = shell.isXcodeCliToolsInstalled var body: some Scene { WindowGroup { - MainView(showToast: $showToast) + MainView(showToast: $showToast, xcodeCliInstalled: $xcodeCliInstalled) .padding() .environmentObject(InstallVM.shared) .environmentObject(AppsVM.shared)