Skip to content

Commit

Permalink
make trackId nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
amendelsohn committed Mar 7, 2025
1 parent 782b0c5 commit 50386ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { ID } from '~/models/Identifiers'
import { createModal } from '../createModal'

export type DeleteTrackConfirmationModalState = {
trackId: ID
trackId: ID | null
}

const deleteTrackConfirmationModal =
createModal<DeleteTrackConfirmationModalState>({
reducerPath: 'DeleteTrackConfirmation',
initialState: {
isOpen: false,
trackId: 0
trackId: null
},
sliceSelector: (state) => state.ui.modals
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const DeleteTrackConfirmationModal = () => {
const { mutateAsync: deleteTrack } = useDeleteTrack()

const handleConfirm = useCallback(() => {
if (!trackId) return
deleteTrack({ trackId, source: 'delete_track_confirmation_modal' })
onClose()
}, [trackId, deleteTrack, onClose])
Expand Down

0 comments on commit 50386ea

Please sign in to comment.