From 16b9f84583769eff6d34afbae683102386a41000 Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Sat, 29 Mar 2025 10:18:45 -0500 Subject: [PATCH] fix carplay? --- components/CarPlay/Navigation.tsx | 3 ++- components/provider.tsx | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/CarPlay/Navigation.tsx b/components/CarPlay/Navigation.tsx index 4d995a38..85b12e1f 100644 --- a/components/CarPlay/Navigation.tsx +++ b/components/CarPlay/Navigation.tsx @@ -3,7 +3,8 @@ import CarPlayHome from "./Home"; import CarPlayDiscover from "./Discover"; const CarPlayNavigation : TabBarTemplate = new TabBarTemplate({ - title: 'Navigation', + id: "Tabs", + title: 'Tabs', templates: [ CarPlayHome, CarPlayDiscover diff --git a/components/provider.tsx b/components/provider.tsx index 1bd58270..5974f46a 100644 --- a/components/provider.tsx +++ b/components/provider.tsx @@ -1,13 +1,13 @@ import Client from "../api/client"; -import { isUndefined } from "lodash"; +import { isNull, isUndefined } from "lodash"; import { createContext, ReactNode, SetStateAction, useContext, useEffect, useState } from "react"; import { Platform } from 'react-native' import { CarPlayInterface, NowPlayingTemplate, TabBarTemplate } from "react-native-carplay"; // 'react-native-carplay' has also been disabled for android builds in react-native.config.js const CarPlay = Platform.OS === 'ios' ? require('react-native-carplay').CarPlay as CarPlayInterface : null; -const CarPlayNavigation : TabBarTemplate = CarPlay ? require('./CarPlay/Navigation').CarPlayNavigation : null; -const CarPlayNowPlaying : NowPlayingTemplate = CarPlay ? require('./CarPlay/NowPlaying').CarPlayNowPlaying : null; +const CarPlayNavigation : TabBarTemplate = isNull(CarPlay) ? require('./CarPlay/Navigation').CarPlayNavigation : null; +const CarPlayNowPlaying : NowPlayingTemplate = isNull(CarPlay) ? require('./CarPlay/NowPlaying').CarPlayNowPlaying : null; interface JellifyContext { loggedIn: boolean;