Merge pull request #110 from anultravioletaurora/9-again-implement-playlist-crud

Fix CarPlay Runtime Errors
This commit is contained in:
Violet Caulfield
2025-02-11 16:32:07 -06:00
committed by GitHub
3 changed files with 7 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ const CarPlayHome : ListTemplate = new ListTemplate({
tabTitle: "Home",
sections: [
{
header: Client.user!.name,
header: `Hi ${Client.user?.name ?? "there"}`,
items: [
{ id: QueryKeys.RecentlyPlayedArtists, text: 'Recent Artists' },
{ id: QueryKeys.RecentlyPlayed, text: 'Recently Played'},

View File

@@ -12,7 +12,7 @@ export const CarPlayRecentlyPlayed = (recentTracks : BaseItemDto[]) => new GridT
track.Name ? track.Name : "Untitled Track"
],
image: {
uri: getImageApi(Client.api!).getItemImageUrlById(track.Id!)
uri: Client.api ? getImageApi(Client.api).getItemImageUrlById(track.Id!) : ""
}
}
})

View File

@@ -27,8 +27,11 @@ const JellifyContextInitializer = () => {
function onConnect() {
setCarPlayConnected(true);
CarPlay.setRootTemplate(CarPlayNavigation, true);
// CarPlay.enableNowPlaying(true); // https://github.com/birkir/react-native-carplay/issues/185
if (loggedIn) {
CarPlay.setRootTemplate(CarPlayNavigation, true);
// CarPlay.enableNowPlaying(true); // https://github.com/birkir/react-native-carplay/issues/185
}
}
function onDisconnect() {