From 36167a725389dc8e64f1b603ea1647f4d14f25f0 Mon Sep 17 00:00:00 2001 From: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com> Date: Wed, 5 Nov 2025 13:35:35 -0600 Subject: [PATCH] hotfix for swipe actions fixing a crash when attempting to add a track to the queue --- ios/Jellify.xcodeproj/project.pbxproj | 20 ++++++++++---------- src/api/mutations/authentication/index.ts | 2 +- src/components/Global/components/track.tsx | 12 +++++++++--- src/components/Player/index.tsx | 14 ++++---------- src/providers/Player/functions/queue.ts | 11 ++++++++--- src/screens/Login/server-address.tsx | 7 ++++++- src/screens/Login/server-authentication.tsx | 6 ++++++ 7 files changed, 44 insertions(+), 28 deletions(-) diff --git a/ios/Jellify.xcodeproj/project.pbxproj b/ios/Jellify.xcodeproj/project.pbxproj index d3b7a22e..ef50cf6d 100644 --- a/ios/Jellify.xcodeproj/project.pbxproj +++ b/ios/Jellify.xcodeproj/project.pbxproj @@ -93,6 +93,8 @@ /* Begin PBXFileSystemSynchronizedRootGroup section */ CFE47DDB2EA56B0200EB6067 /* icons */ = { isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + ); path = icons; sourceTree = ""; }; @@ -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; diff --git a/src/api/mutations/authentication/index.ts b/src/api/mutations/authentication/index.ts index 08867f87..bb2f539b 100644 --- a/src/api/mutations/authentication/index.ts +++ b/src/api/mutations/authentication/index.ts @@ -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)) diff --git a/src/components/Global/components/track.tsx b/src/components/Global/components/track.tsx index 5961dce4..75eb8b6a 100644 --- a/src/components/Global/components/track.tsx +++ b/src/components/Global/components/track.tsx @@ -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, ], ) diff --git a/src/components/Player/index.tsx b/src/components/Player/index.tsx index 62134cdc..39fc507a 100644 --- a/src/components/Player/index.tsx +++ b/src/components/Player/index.tsx @@ -170,19 +170,13 @@ export default function PlayerScreen(): React.JSX.Element { {...mainContainerStyle} > {/* flexGrow 1 */} - - - - + + - - {/* playback progress goes here */} - - -