From 7434897eace9c927e6b558634be491a721a1fa0d Mon Sep 17 00:00:00 2001 From: leminlimez Date: Sat, 19 Jul 2025 09:02:08 -0400 Subject: [PATCH] dont show carplay menu on ipads --- Pocket Poster/Views/RootView.swift | 10 ++++++---- Pocket Poster/Views/SettingsView.swift | 22 +++++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Pocket Poster/Views/RootView.swift b/Pocket Poster/Views/RootView.swift index c0af04c..ff3a114 100644 --- a/Pocket Poster/Views/RootView.swift +++ b/Pocket Poster/Views/RootView.swift @@ -18,10 +18,12 @@ struct RootView: View { .tabItem { Label("Videos", systemImage: "camera") } - CarPlayView() - .tabItem { - Label("CarPlay", systemImage: "car") - } + if UIDevice.current.userInterfaceIdiom == .phone { + CarPlayView() + .tabItem { + Label("CarPlay", systemImage: "car") + } + } ExploreView() .tabItem { Label("Explore", systemImage: "safari") diff --git a/Pocket Poster/Views/SettingsView.swift b/Pocket Poster/Views/SettingsView.swift index d87ee9d..a7e39e8 100644 --- a/Pocket Poster/Views/SettingsView.swift +++ b/Pocket Poster/Views/SettingsView.swift @@ -23,9 +23,11 @@ struct SettingsView: View { TextField("Enter PosterBoard App Hash", text: $pbHash) .textFieldStyle(RoundedBorderTextFieldStyle()) .font(.system(.body, design: .monospaced)) - TextField("Enter CarPlayWallpaper App Hash", text: $cpHash) - .textFieldStyle(RoundedBorderTextFieldStyle()) - .font(.system(.body, design: .monospaced)) + if UIDevice.current.userInterfaceIdiom == .phone { + TextField("Enter CarPlayWallpaper App Hash", text: $cpHash) + .textFieldStyle(RoundedBorderTextFieldStyle()) + .font(.system(.body, design: .monospaced)) + } HStack { Spacer() // Run task to check until file exists from Nugget pc over AFC @@ -164,12 +166,14 @@ struct SettingsView: View { pbHash = contents } // check for carplay hash - let carplayPath = SymHandler.getCarPlayHashURL() - if FileManager.default.fileExists(atPath: carplayPath.path()) { - let carplayContents = try String(contentsOf: carplayPath) - try? FileManager.default.removeItem(at: carplayPath) - await MainActor.run { - cpHash = carplayContents + if UIDevice.current.userInterfaceIdiom == .phone { + let carplayPath = SymHandler.getCarPlayHashURL() + if FileManager.default.fileExists(atPath: carplayPath.path()) { + let carplayContents = try String(contentsOf: carplayPath) + try? FileManager.default.removeItem(at: carplayPath) + await MainActor.run { + cpHash = carplayContents + } } } } catch {