-
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
Conversation
@@ -46,6 +49,10 @@ function* filterDeletes(tracksMetadata, removeDeleted) { | |||
const remoteConfig = yield getContext('remoteConfigInstance') | |||
yield call(remoteConfig.waitForRemoteConfig) | |||
|
|||
const isUSDCGatedContentEnabled = yield getFeatureEnabled( |
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 what waitForRead
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.
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.
awesome!
seeing type errors and noticed that latest commit is a merge from main, probably bad merge there.
@@ -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 comment
The 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.
Starting to wonder if this is actually useful as it requires calling multiple type checker functions each time we're trying to switch on the gate type? 😬
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.
yeah sigh.. it's still gives more type safety tho right?
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.
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.
Preview this change https://demo.audius.co/pay-1578-hide-usdc-tracks |
Description
Using a similar strategy to #2956 , inserts a step into the lineup processing that treats USDC-gated tracks as "deleted" in all cases. This should take care of all environments since it's done at the generic lineup saga level.
Dragons
You could still navigate directly to a USDC-gated track. But I think our goal for now is to not surface these tracks into feeds/trending/artist pages.
How Has This Been Tested?
Tested locally on web/mobile web/ simulator
How will this change be monitored?
N/A
Feature Flags
Uses the USDC_PURCHASES feature flag. On by default in development.