dont show carplay menu on ipads

This commit is contained in:
leminlimez committed 2025-07-19 09:02:08 -04:00
1 parent 395cbe5e13
commit 7434897eac
2 files changed
+19 -13

No files matched your search

+6 -4
View File
@@ -18,10 +18,12 @@ struct RootView: View {
.tabItem { .tabItem {
Label("Videos", systemImage: "camera") Label("Videos", systemImage: "camera")
} }
CarPlayView() if UIDevice.current.userInterfaceIdiom == .phone {
.tabItem { CarPlayView()
Label("CarPlay", systemImage: "car") .tabItem {
} Label("CarPlay", systemImage: "car")
}
}
ExploreView() ExploreView()
.tabItem { .tabItem {
Label("Explore", systemImage: "safari") Label("Explore", systemImage: "safari")
+13 -9
View File
@@ -23,9 +23,11 @@ struct SettingsView: View {
TextField("Enter PosterBoard App Hash", text: $pbHash) TextField("Enter PosterBoard App Hash", text: $pbHash)
.textFieldStyle(RoundedBorderTextFieldStyle()) .textFieldStyle(RoundedBorderTextFieldStyle())
.font(.system(.body, design: .monospaced)) .font(.system(.body, design: .monospaced))
TextField("Enter CarPlayWallpaper App Hash", text: $cpHash) if UIDevice.current.userInterfaceIdiom == .phone {
.textFieldStyle(RoundedBorderTextFieldStyle()) TextField("Enter CarPlayWallpaper App Hash", text: $cpHash)
.font(.system(.body, design: .monospaced)) .textFieldStyle(RoundedBorderTextFieldStyle())
.font(.system(.body, design: .monospaced))
}
HStack { HStack {
Spacer() Spacer()
// Run task to check until file exists from Nugget pc over AFC // Run task to check until file exists from Nugget pc over AFC
@@ -164,12 +166,14 @@ struct SettingsView: View {
pbHash = contents pbHash = contents
} }
// check for carplay hash // check for carplay hash
let carplayPath = SymHandler.getCarPlayHashURL() if UIDevice.current.userInterfaceIdiom == .phone {
if FileManager.default.fileExists(atPath: carplayPath.path()) { let carplayPath = SymHandler.getCarPlayHashURL()
let carplayContents = try String(contentsOf: carplayPath) if FileManager.default.fileExists(atPath: carplayPath.path()) {
try? FileManager.default.removeItem(at: carplayPath) let carplayContents = try String(contentsOf: carplayPath)
await MainActor.run { try? FileManager.default.removeItem(at: carplayPath)
cpHash = carplayContents await MainActor.run {
cpHash = carplayContents
}
} }
} }
} catch { } catch {