mirror of
https://github.com/Jellify-Music/App.git
synced 2026-02-19 18:28:51 -06:00
hotfix for swipe actions
fixing a crash when attempting to add a track to the queue
This commit is contained in:
@@ -93,6 +93,8 @@
|
||||
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
||||
CFE47DDB2EA56B0200EB6067 /* icons */ = {
|
||||
isa = PBXFileSystemSynchronizedRootGroup;
|
||||
exceptions = (
|
||||
);
|
||||
path = icons;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -395,14 +397,10 @@
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Jellify/Pods-Jellify-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Jellify/Pods-Jellify-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Jellify/Pods-Jellify-frameworks.sh\"\n";
|
||||
@@ -416,14 +414,10 @@
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Jellify/Pods-Jellify-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Jellify/Pods-Jellify-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Jellify/Pods-Jellify-resources.sh\"\n";
|
||||
@@ -703,7 +697,10 @@
|
||||
"-DFOLLY_CFG_NO_COROUTINES=1",
|
||||
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
||||
);
|
||||
OTHER_LDFLAGS = "$(inherited) ";
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
" ",
|
||||
);
|
||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
||||
SDKROOT = iphoneos;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
@@ -790,7 +787,10 @@
|
||||
"-DFOLLY_CFG_NO_COROUTINES=1",
|
||||
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
||||
);
|
||||
OTHER_LDFLAGS = "$(inherited) ";
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
" ",
|
||||
);
|
||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
||||
SDKROOT = iphoneos;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
|
||||
@@ -30,7 +30,7 @@ const useAuthenticateUserByName = ({ onSuccess, onError }: AuthenticateUserByNam
|
||||
if (isUndefined(authResult))
|
||||
return Promise.reject(new Error('Authentication result was empty'))
|
||||
|
||||
if (authResult.status >= 400 || isUndefined(authResult.data.AccessToken))
|
||||
if (authResult.status == 400 || isUndefined(authResult.data.AccessToken))
|
||||
return Promise.reject(new Error('Invalid credentials'))
|
||||
|
||||
if (isUndefined(authResult.data.User))
|
||||
|
||||
@@ -25,6 +25,7 @@ import { useIsFavorite } from '../../../api/queries/user-data'
|
||||
import { useApi } from '../../../stores'
|
||||
import { useCurrentTrack, usePlayQueue } from '../../../stores/player/queue'
|
||||
import { useAddFavorite, useRemoveFavorite } from '../../../api/mutations/favorite'
|
||||
import { StackActions } from '@react-navigation/native'
|
||||
|
||||
export interface TrackProps {
|
||||
track: BaseItemDto
|
||||
@@ -179,9 +180,13 @@ export default function Track({
|
||||
tracks: [track],
|
||||
queuingType: QueuingType.DirectlyQueued,
|
||||
}),
|
||||
toggleFavorite: () =>
|
||||
isFavoriteTrack ? removeFavorite({ item: track }) : addFavorite({ item: track }),
|
||||
addToPlaylist: () => navigationRef.navigate('AddToPlaylist', { track }),
|
||||
toggleFavorite: () => {
|
||||
if (isFavoriteTrack) removeFavorite({ item: track })
|
||||
else addFavorite({ item: track })
|
||||
},
|
||||
addToPlaylist: () => {
|
||||
navigationRef.dispatch(StackActions.push('AddToPlaylist', { track }))
|
||||
},
|
||||
}),
|
||||
[
|
||||
addToQueue,
|
||||
@@ -192,6 +197,7 @@ export default function Track({
|
||||
addFavorite,
|
||||
removeFavorite,
|
||||
isFavoriteTrack,
|
||||
navigationRef,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -170,19 +170,13 @@ export default function PlayerScreen(): React.JSX.Element {
|
||||
{...mainContainerStyle}
|
||||
>
|
||||
{/* flexGrow 1 */}
|
||||
<YStack>
|
||||
<PlayerHeader />
|
||||
<SongInfo />
|
||||
</YStack>
|
||||
<PlayerHeader />
|
||||
|
||||
<YStack justifyContent='flex-start' gap={'$5'} flexShrink={1}>
|
||||
<SongInfo />
|
||||
<Scrubber />
|
||||
|
||||
{/* playback progress goes here */}
|
||||
<YStack>
|
||||
<Controls />
|
||||
<Footer />
|
||||
</YStack>
|
||||
<Controls />
|
||||
<Footer />
|
||||
</YStack>
|
||||
</YStack>
|
||||
</Animated.View>
|
||||
|
||||
@@ -116,13 +116,18 @@ export const playNextInQueue = async ({
|
||||
)
|
||||
|
||||
const currentIndex = await TrackPlayer.getActiveTrackIndex()
|
||||
const currentQueue = (await TrackPlayer.getQueue()) as JellifyTrack[]
|
||||
|
||||
console.debug(`Adding ${tracks.length} to the queue at index ${currentIndex}`)
|
||||
// Then update RNTP
|
||||
await TrackPlayer.add(tracksToPlayNext, (currentIndex ?? 0) + 1)
|
||||
|
||||
// If we're already at the end of the queue, add the track to the end
|
||||
if (currentIndex === currentQueue.length - 1) await TrackPlayer.add(tracksToPlayNext)
|
||||
// Else as long as we have an active index, we'll add the track(s) after that
|
||||
else if (currentIndex) await TrackPlayer.add(tracksToPlayNext, currentIndex + 1)
|
||||
|
||||
// Get the active queue, put it in Zustand
|
||||
const updatedQueue = (await TrackPlayer.getQueue()) as JellifyTrack[]
|
||||
usePlayerQueueStore.getState().setQueue(updatedQueue)
|
||||
usePlayerQueueStore.getState().setQueue([...updatedQueue])
|
||||
|
||||
// Add to the state unshuffled queue, using the currently playing track as the index
|
||||
usePlayerQueueStore
|
||||
|
||||
@@ -94,8 +94,13 @@ export default function ServerAddress({
|
||||
autoCorrect={false}
|
||||
secureTextEntry={IS_MAESTRO_BUILD} // If Maestro build, don't show the server address as screen Records
|
||||
flex={1}
|
||||
placeholder='jellyfin.org'
|
||||
placeholder='demo.jellyfin.org/stable'
|
||||
testID='server_address_input'
|
||||
returnKeyType='go'
|
||||
onSubmitEditing={() => {
|
||||
if (!isUndefined(serverAddress))
|
||||
connectToServer({ serverAddress, useHttps })
|
||||
}}
|
||||
/>
|
||||
</XStack>
|
||||
|
||||
|
||||
@@ -83,6 +83,12 @@ export default function ServerAuthentication({
|
||||
textContentType='password'
|
||||
importantForAutofill='yes'
|
||||
returnKeyType='go'
|
||||
onSubmitEditing={() => {
|
||||
if (!_.isUndefined(username)) {
|
||||
console.log(`Signing in...`)
|
||||
authenticateUserByName({ username, password })
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
<Spacer />
|
||||
|
||||
Reference in New Issue
Block a user