fix build

This commit is contained in:
Violet Caulfield
2025-02-15 07:49:20 -06:00
parent faf1d1fe3f
commit 287c75cc4c
2 changed files with 37 additions and 37 deletions

37
App.tsx
View File

@@ -9,10 +9,6 @@ import jellifyConfig from './tamagui.config';
import { clientPersister } from './constants/storage';
import { queryClient } from './constants/query-client';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { QueryKeys } from './enums/query-keys';
import { useQuery } from '@tanstack/react-query';
import TrackPlayer, { IOSCategory, IOSCategoryOptions } from 'react-native-track-player';
import { CAPABILITIES } from './player/constants';
// export const backgroundRuntime = createWorkletRuntime('background');
@@ -20,39 +16,6 @@ export default function App(): React.JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
const { isSuccess: isPlayerReady } = useQuery({
queryKey: [QueryKeys.Player],
queryFn: async () => {
await TrackPlayer.setupPlayer({
autoHandleInterruptions: true,
maxCacheSize: 1000 * 100, // 100MB, TODO make this adjustable
iosCategory: IOSCategory.Playback,
iosCategoryOptions: [
IOSCategoryOptions.AllowAirPlay,
IOSCategoryOptions.AllowBluetooth,
]
});
return await TrackPlayer.updateOptions({
progressUpdateEventInterval: 1,
capabilities: CAPABILITIES,
notificationCapabilities: CAPABILITIES,
compactCapabilities: CAPABILITIES,
// ratingType: RatingType.Heart,
// likeOptions: {
// isActive: false,
// title: "Favorite"
// },
// dislikeOptions: {
// isActive: true,
// title: "Unfavorite"
// }
});
},
retry: 0,
staleTime: 1000 * 60 * 60 * 24 * 7 // 7 days
});
return (
<PersistQueryClientProvider
client={queryClient}

View File

@@ -12,9 +12,46 @@ import { PortalProvider } from "@tamagui/portal";
import { JellifyProvider, useJellifyContext } from "./provider";
import { ToastProvider, ToastViewport } from "@tamagui/toast";
import SafeToastViewport from "./Global/components/toast-area-view-port";
import { QueryKeys } from "../enums/query-keys";
import { useQuery } from "@tanstack/react-query";
import TrackPlayer, { IOSCategory, IOSCategoryOptions } from "react-native-track-player";
import { CAPABILITIES } from "../player/constants";
export default function Jellify(): React.JSX.Element {
const { isSuccess: isPlayerReady } = useQuery({
queryKey: [QueryKeys.Player],
queryFn: async () => {
await TrackPlayer.setupPlayer({
autoHandleInterruptions: true,
maxCacheSize: 1000 * 100, // 100MB, TODO make this adjustable
iosCategory: IOSCategory.Playback,
iosCategoryOptions: [
IOSCategoryOptions.AllowAirPlay,
IOSCategoryOptions.AllowBluetooth,
]
});
return await TrackPlayer.updateOptions({
progressUpdateEventInterval: 1,
capabilities: CAPABILITIES,
notificationCapabilities: CAPABILITIES,
compactCapabilities: CAPABILITIES,
// ratingType: RatingType.Heart,
// likeOptions: {
// isActive: false,
// title: "Favorite"
// },
// dislikeOptions: {
// isActive: true,
// title: "Unfavorite"
// }
});
},
retry: 0,
staleTime: 1000 * 60 * 60 * 24 * 7 // 7 days
});
return (
<PortalProvider shouldAddRootHost>
<ToastProvider burntOptions={{ from: 'top'}}>