Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 0 additions & 2 deletions packages/common/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export * from './tan-query/users/useTopArtistsInGenre'
export * from './tan-query/users/useUserAlbums'
export * from './tan-query/users/useUserByHandle'
export * from './tan-query/users/useUserByParams'
export * from './tan-query/users/useUserCollectibles'
export * from './tan-query/users/useUserPlaylists'
export * from './tan-query/users/useUsers'
export * from './tan-query/users/useUser'
Expand Down Expand Up @@ -173,7 +172,6 @@ export * from './tan-query/users/account/useSyncLocalStorageUser'
// Wallet logic
export * from './tan-query/wallets/useAudioBalance'
export * from './tan-query/wallets/useConnectedWallets'
export * from './tan-query/wallets/useWalletCollectibles'
export * from './tan-query/wallets/useWalletOwner'
export * from './tan-query/wallets/useUSDCBalance'
export * from './tan-query/wallets/useTokenBalance'
Expand Down
100 changes: 0 additions & 100 deletions packages/common/src/api/tan-query/users/useUserCollectibles.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/common/src/api/tan-query/utils/QueryContext.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { createContext, useContext } from 'react'

import type { FetchNFTClient } from '@audius/fetch-nft'
import type { AudiusSdk } from '@audius/sdk'
import type { Dispatch } from 'redux'
import { getContext } from 'typed-redux-saga'
Expand Down Expand Up @@ -51,7 +50,7 @@ export type QueryContextType = {
properties: any
}
}
nftClient: FetchNFTClient
nftClient: null
imageUtils: {
generatePlaylistArtwork: (
urls: string[]
Expand Down Expand Up @@ -100,7 +99,7 @@ export function* getQueryContext(): Generator<any, QueryContextType, any> {
reportToSentry:
yield* getContext<QueryContextType['reportToSentry']>('reportToSentry'),
analytics: yield* getContext<QueryContextType['analytics']>('analytics'),
nftClient: yield* getContext<QueryContextType['nftClient']>('nftClient'),
nftClient: null,
imageUtils: yield* getContext<QueryContextType['imageUtils']>('imageUtils')
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { toast } from '~/store/ui/toast/slice'

import { QUERY_KEYS } from '../queryKeys'
import { useCurrentUserId } from '../users/account/useCurrentUserId'
import { getUserCollectiblesQueryKey } from '../users/useUserCollectibles'

export type ConnectedWallet = {
address: string
Expand Down Expand Up @@ -134,9 +133,6 @@ export const useAddConnectedWallet = () => {
await queryClient.invalidateQueries({
queryKey: getConnectedWalletsQueryKey({ userId: currentUserId })
})
queryClient.invalidateQueries({
queryKey: getUserCollectiblesQueryKey({ userId: currentUserId })
})

// Temporarily manually refetch relevant redux states
dispatch(
Expand Down Expand Up @@ -198,9 +194,6 @@ export const useRemoveConnectedWallet = () => {
queryClient.invalidateQueries({
queryKey: getConnectedWalletsQueryKey({ userId: currentUserId })
})
queryClient.invalidateQueries({
queryKey: getUserCollectiblesQueryKey({ userId: currentUserId })
})
// Invalidate user coin query to update balances
queryClient.invalidateQueries({
queryKey: [QUERY_KEYS.userCoin, currentUserId]
Expand Down
46 changes: 0 additions & 46 deletions packages/common/src/api/tan-query/wallets/useWalletCollectibles.ts

This file was deleted.

19 changes: 0 additions & 19 deletions packages/common/src/hooks/useAccessAndRemixSettings.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { useSelector } from 'react-redux'

import { useArtistOwnedCoin, useCurrentUserId } from '~/api/'
import { getSupportedUserCollections } from '~/store/collectibles/selectors'
import { CommonState } from '~/store/reducers'

type UseAccessAndRemixSettingsProps = {
isUpload: boolean
Expand All @@ -13,16 +9,6 @@ type UseAccessAndRemixSettingsProps = {
isPublishDisabled?: boolean
}

export const useHasNoCollectibles = () => {
const { data: userId } = useCurrentUserId()
const { isLoading, ethCollectionMap, solCollectionMap } = useSelector(
(state: CommonState) => getSupportedUserCollections(state, { userId })
)
const numEthCollectibles = Object.keys(ethCollectionMap).length
const numSolCollectibles = Object.keys(solCollectionMap).length
return !isLoading && numEthCollectibles + numSolCollectibles === 0
}

export const useHasNoTokens = () => {
const { data: userId } = useCurrentUserId()
const { data: coin, isLoading } = useArtistOwnedCoin(userId)
Expand Down Expand Up @@ -55,17 +41,12 @@ export const useAccessAndRemixSettings = ({
const isInitiallyHidden = !isUpload && isInitiallyUnlisted
const shouldDisablePublish = isPublishDisabled && isInitiallyHidden

const hasNoCollectibles = useHasNoCollectibles()
const hasNoTokens = useHasNoTokens()

return {
disableUsdcGate: isRemix || shouldDisablePublish,
disableSpecialAccessGate: isAlbum || isRemix || shouldDisablePublish,
disableSpecialAccessGateFields: isAlbum || isRemix || shouldDisablePublish,
disableCollectibleGate:
isAlbum || isRemix || hasNoCollectibles || shouldDisablePublish,
disableCollectibleGateFields:
isAlbum || isRemix || hasNoCollectibles || shouldDisablePublish,
disableTokenGate: isAlbum || isRemix || hasNoTokens || shouldDisablePublish,
disableTokenGateFields:
isAlbum || isRemix || hasNoTokens || shouldDisablePublish,
Expand Down
11 changes: 0 additions & 11 deletions packages/common/src/messages/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const priceAndAudienceMessages = {
free: 'Free for Everyone',
premium: 'Premium',
specialAccess: 'Special Access',
collectibleGated: 'Collectible Gated',
coinGated: 'Coin Gated',
hidden: 'Hidden',
followersOnly: 'Followers Only',
Expand Down Expand Up @@ -57,16 +56,6 @@ export const priceAndAudienceMessages = {
followersOnly: 'Followers Only',
supportersOnly: 'Supporters Only'
},
collectibleGatedRadio: {
title: 'Collectible Gated',
description:
'Only fans who own a specific, digital collectible can play your track. (These tracks remain hidden from trending lists and user feeds.)',
learnMore: 'Learn More',
pickACollection: 'Pick a Collection',
ownersOf: 'Owners Of',
noCollectibles:
'No collectibles found. Link a wallet containing a digital collectible to enable this option.'
},
tokenGatedRadio: {
title: 'Coin Gated',
yourCoin: 'your coin',
Expand Down
55 changes: 0 additions & 55 deletions packages/common/src/models/Collectible.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/common/src/models/CollectibleState.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/common/src/models/User.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Collectible } from '~/models/Collectible'
import { Color } from '~/models/Color'
import { CID, ID } from '~/models/Identifiers'
import {
Expand Down Expand Up @@ -31,7 +30,6 @@ export type UserMetadata = {
balance?: Nullable<StringWei>
bio: Nullable<string>
blocknumber: number
collectibleList?: Collectible[]
cover_photo_cids?: Nullable<CoverPhotoSizesCids>
cover_photo_sizes: Nullable<CID>
cover_photo: CoverPhotoSizes & { mirrors?: string[] | undefined }
Expand Down Expand Up @@ -64,7 +62,6 @@ export type UserMetadata = {
profile_picture_sizes: Nullable<CID>
profile_picture: ProfilePictureSizes & { mirrors?: string[] | undefined }
repost_count: number
solanaCollectibleList?: Collectible[]
spl_wallet: Nullable<SolanaWalletAddress>
spl_usdc_payout_wallet?: Nullable<SolanaWalletAddress>
supporter_count: number
Expand Down
2 changes: 0 additions & 2 deletions packages/common/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export * from './Cache'
export * from './Chain'
export * from './Chat'
export * from './Client'
export * from './Collectible'
export * from './CollectibleState'
export * from './Collection'
export * from './Color'
export * from './DogEar'
Expand Down
Loading