-
Notifications
You must be signed in to change notification settings - Fork 42
[PAY-1578] Hide USDC-gated tracks if the feature flag is disabled #3752
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import { useCallback, useMemo } from 'react' | |
import { | ||
Chain, | ||
collectiblesSelectors, | ||
isPremiumContentCollectibleGated, | ||
TrackAvailabilityType | ||
} from '@audius/common' | ||
import { useField } from 'formik' | ||
|
@@ -106,8 +107,11 @@ export const CollectibleGatedFields = ({ | |
// which makes the dropdown show the placeholder. | ||
// Otherwise, the default value is the nft collection which was previously selected, | ||
// which also includes the collection image. | ||
const defaultCollectionName = | ||
premiumConditionsValue?.nft_collection?.name ?? '' | ||
const defaultCollectionName = isPremiumContentCollectibleGated( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dharit-tan You were correct on the bad merge. There are some new reads of the gating conditions on main that needed to be updated to use the union type. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah sigh.. it's still gives more type safety tho right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does! And it's useful in the cases where you're checking for one specific condition before moving forward. I think it's clunky for the handful of cases where we are handling all of the types of premium content in one place. |
||
premiumConditionsValue | ||
) | ||
? premiumConditionsValue.nft_collection?.name ?? '' | ||
: '' | ||
const defaultCollection = menuItems.find( | ||
(item) => item.text === defaultCollectionName | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: In the PR I based this on, there was a
waitForRead()
at this point. Looking into whatwaitForRead
is waiting on (reachability and account), I don't think there's any additional need to wait on that condition here if the original lineup processing wasn't already waiting for it.But if others can think of a reason why we should, I'm happy to add it.