Skip to content

Commit 538ad66

Browse files
VGR-GITclaude
andauthored
chore(rewards): fix campaign param extract (#29856)
## **Description** - "?~campaign=ondo&__branch_flow_id=1580894552734833035&~referring_browser=Chrome" would fail to be parsed correctly, the campaign param we extract would be null, and the user would end up in the rewards dashboard instead of the ondo details campaign page. - Added support for upcoming perps trading comp deeplink ## **Changelog** CHANGELOG entry: null <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: small, localized change to rewards deeplink query parsing that may only affect navigation routing for rewards campaign links. > > **Overview** > Rewards deeplink parsing now falls back to reading Branch-style `~campaign` when `campaign` is missing, preventing campaign links from dropping users onto the generic rewards dashboard. > > It also expands allowed campaign values to include the new `perps-comp` campaign so those deeplinks can route correctly. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ddca21a. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f2d69c4 commit 538ad66

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/core/DeeplinkManager/handlers/legacy/handleRewardsUrl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface HandleRewardsUrlParams {
1818
interface RewardsNavigationParams {
1919
referral?: string;
2020
page?: 'campaigns' | 'musd' | 'benefits';
21-
campaign?: 'ondo' | 'season1';
21+
campaign?: 'ondo' | 'season1' | 'perps-comp';
2222
}
2323

2424
/**
@@ -34,7 +34,7 @@ const parseRewardsNavigationParams = (
3434
);
3535

3636
const pageParam = urlParams.get('page');
37-
const campaignParam = urlParams.get('campaign');
37+
const campaignParam = urlParams.get('campaign') ?? urlParams.get('~campaign');
3838

3939
return {
4040
referral:
@@ -43,7 +43,7 @@ const parseRewardsNavigationParams = (
4343
page: (['campaigns', 'musd', 'benefits'].includes(pageParam ?? '')
4444
? pageParam
4545
: undefined) as RewardsNavigationParams['page'],
46-
campaign: (['ondo', 'season1'].includes(campaignParam ?? '')
46+
campaign: (['ondo', 'season1', 'perps-comp'].includes(campaignParam ?? '')
4747
? campaignParam
4848
: undefined) as RewardsNavigationParams['campaign'],
4949
};

0 commit comments

Comments
 (0)