Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 7 additions & 179 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
"@jup-ag/api": "6.0.44",
"@metaplex-foundation/mpl-token-metadata": "2.5.2",
"@optimizely/optimizely-sdk": "4.0.0",
"@tanstack/react-query": "5.90.16",
"@tanstack/react-query-devtools": "5.91.2",
"@tanstack/react-query": "5.62.7",
"@yornaath/batshit": "0.10.1",
"async-retry": "1.3.3",
"dayjs": "^1.11.19",
Expand Down
45 changes: 45 additions & 0 deletions packages/common/src/api/tan-query/upload/mutationOptions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// TEMPORARY PORT OF TANSTACK QUERY TYPES
// To avoid dependency issues with newer versions of tanstack query
// Remove when we can upgrade Tanstack Query without breaking the production static builds

import type { DefaultError, WithRequired } from '@tanstack/query-core'
import type { UseMutationOptions } from '@tanstack/react-query'

export function mutationOptions<
TData = unknown,
TError = DefaultError,
TVariables = void,
TOnMutateResult = unknown
>(
options: WithRequired<
UseMutationOptions<TData, TError, TVariables, TOnMutateResult>,
'mutationKey'
>
): WithRequired<
UseMutationOptions<TData, TError, TVariables, TOnMutateResult>,
'mutationKey'
>
export function mutationOptions<
TData = unknown,
TError = DefaultError,
TVariables = void,
TOnMutateResult = unknown
>(
options: Omit<
UseMutationOptions<TData, TError, TVariables, TOnMutateResult>,
'mutationKey'
>
): Omit<
UseMutationOptions<TData, TError, TVariables, TOnMutateResult>,
'mutationKey'
>
export function mutationOptions<
TData = unknown,
TError = DefaultError,
TVariables = void,
TOnMutateResult = unknown
>(
options: UseMutationOptions<TData, TError, TVariables, TOnMutateResult>
): UseMutationOptions<TData, TError, TVariables, TOnMutateResult> {
return options
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { HashId, Id, type UploadResponse } from '@audius/sdk'
import {
mutationOptions,
useMutation,
useQueryClient
} from '@tanstack/react-query'
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { mapValues } from 'lodash'
import { useDispatch } from 'react-redux'

Expand Down Expand Up @@ -33,6 +29,7 @@ import {
addPremiumMetadata,
getUSDCMetadata
} from './usePublishTracks'
import { mutationOptions } from './mutationOptions'

type PublishCollectionContext = Pick<
QueryContextType,
Expand Down
7 changes: 2 additions & 5 deletions packages/common/src/api/tan-query/upload/usePublishStems.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { HashId, Id, type UploadResponse } from '@audius/sdk'
import {
mutationOptions,
useMutation,
useQueryClient
} from '@tanstack/react-query'
import { useMutation, useQueryClient } from '@tanstack/react-query'

import {
StemCategory,
Expand All @@ -16,6 +12,7 @@ import { ProgressStatus, uploadActions } from '~/store'
import { getStemsQueryKey } from '../tracks/useStems'
import { useCurrentUserId } from '../users/account/useCurrentUserId'
import { useQueryContext, type QueryContextType } from '../utils'
import { mutationOptions } from './mutationOptions'

const { updateProgress } = uploadActions

Expand Down
7 changes: 2 additions & 5 deletions packages/common/src/api/tan-query/upload/usePublishTracks.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { USDC } from '@audius/fixed-decimal'
import { HashId, Id, type UploadResponse } from '@audius/sdk'
import {
mutationOptions,
useMutation,
useQueryClient
} from '@tanstack/react-query'
import { useMutation, useQueryClient } from '@tanstack/react-query'

import { trackMetadataForUploadToSdk } from '~/adapters'
import {
Expand All @@ -23,6 +19,7 @@ import { useCurrentAccount } from '../users/account/useCurrentAccount'
import { getUserQueryKey } from '../users/useUser'
import { useQueryContext, type QueryContextType } from '../utils'
import { publishStems } from './usePublishStems'
import { mutationOptions } from './mutationOptions'

const { updateProgress } = uploadActions

Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/api/tan-query/upload/useUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ export const useUpload = () => {
},
feature: Feature.Upload
})
dispatch(uploadActions.uploadTracksFailed())
dispatch(uploadTracksFailed())
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion packages/common/src/api/tan-query/upload/useUploadFiles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type AudiusSdk } from '@audius/sdk'
import { mutationOptions, useMutation } from '@tanstack/react-query'
import { useMutation } from '@tanstack/react-query'
import { mutationOptions } from './mutationOptions'

type UploadFile = {
clientId: string
Expand Down
Loading
Loading