From 44fa25a88e06a5bc876372135d75670ac0312773 Mon Sep 17 00:00:00 2001 From: Daniel Constantin Date: Wed, 10 Jun 2026 15:28:43 +0300 Subject: [PATCH 1/2] fix: race condition in auto verify --- .../src/modules/affiliate/hooks/useAffiliateTraderCodeInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cowswap-frontend/src/modules/affiliate/hooks/useAffiliateTraderCodeInput.ts b/apps/cowswap-frontend/src/modules/affiliate/hooks/useAffiliateTraderCodeInput.ts index 44d782dd233..c60a6952a2d 100644 --- a/apps/cowswap-frontend/src/modules/affiliate/hooks/useAffiliateTraderCodeInput.ts +++ b/apps/cowswap-frontend/src/modules/affiliate/hooks/useAffiliateTraderCodeInput.ts @@ -40,7 +40,7 @@ export function useAffiliateTraderCodeInput(): UseAffiliateTraderCodeInputResult useAffiliateTraderCodeFromUrl(onRecoveredFromUrl) useEffect(() => { - if (shouldAutoVerify.current && !!account) { + if (shouldAutoVerify.current && !!account && !!codeInput) { shouldAutoVerify.current = false verifyCode(codeInput, account) } From 72ae64b7b617e20f7b107c88bb9f34e96e91b4a1 Mon Sep 17 00:00:00 2001 From: Daniel Constantin Date: Wed, 10 Jun 2026 15:42:01 +0300 Subject: [PATCH 2/2] feat: improve affiliate onboarding copy --- apps/cowswap-frontend/src/locales/en-US.po | 43 ++++++++++++++++--- .../AffiliateTraderModalCodeLinking.tsx | 2 +- .../AffiliateTraderModalUnsupported.tsx | 2 +- .../AffiliateTradeCodeForm.tsx | 4 +- .../CodeLinkingSubtitle.tsx | 13 ++++-- 5 files changed, 51 insertions(+), 13 deletions(-) diff --git a/apps/cowswap-frontend/src/locales/en-US.po b/apps/cowswap-frontend/src/locales/en-US.po index 1e37de222f9..f226eed7a40 100644 --- a/apps/cowswap-frontend/src/locales/en-US.po +++ b/apps/cowswap-frontend/src/locales/en-US.po @@ -370,6 +370,11 @@ msgstr "Unwrapping {amountStr} {wrapped} to {native}" msgid "{symbolName} orders require a minimum transaction expiration time threshold of {minutes} minutes to ensure the best swapping experience." msgstr "{symbolName} orders require a minimum transaction expiration time threshold of {minutes} minutes to ensure the best swapping experience." +#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalUnsupported.tsx +#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/AffiliateTradeCodeForm.tsx +msgid "You've been referred - here's your reward" +msgstr "You've been referred - here's your reward" + #: apps/cowswap-frontend/src/modules/tokensList/containers/SelectTokenWidget/hooks/useWidgetMetadata.ts msgid "From network" msgstr "From network" @@ -1000,8 +1005,8 @@ msgstr "Enable Hooks" #~ msgstr "Claim LlamaPay Vesting Hook" #: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx -msgid "Swap once to activate. Earn <0>{rewardAmount} per <1>{triggerVolume} of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet." -msgstr "Swap once to activate. Earn <0>{rewardAmount} per <1>{triggerVolume} of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet." +#~ msgid "Swap once to activate. Earn <0>{rewardAmount} per <1>{triggerVolume} of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet." +#~ msgstr "Swap once to activate. Earn <0>{rewardAmount} per <1>{triggerVolume} of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet." #: apps/cowswap-frontend/src/modules/yield/containers/YieldWidget/index.tsx msgid "Seamlessly swap your tokens into CoW AMM pools" @@ -1020,6 +1025,10 @@ msgstr "Overview" msgid "Loading operation" msgstr "Loading operation" +#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx +msgid "Connect your wallet to activate it and start earning rewards when you trade." +msgstr "Connect your wallet to activate it and start earning rewards when you trade." + #: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliatePartnerOnboard.tsx #~ msgid "Share your referral code and earn <0>{partnerRewardAmount} for every <1>{triggerVolumeLabel} in eligible volume within {affiliateTimeCapDays} days.<2/><3/>" #~ msgstr "Share your referral code and earn <0>{partnerRewardAmount} for every <1>{triggerVolumeLabel} in eligible volume within {affiliateTimeCapDays} days.<2/><3/>" @@ -1196,6 +1205,10 @@ msgstr "Failed" msgid "The amount of extra tokens you get on top of your limit price." msgstr "The amount of extra tokens you get on top of your limit price." +#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalCodeLinking.tsx +msgid "Connect wallet to activate" +msgstr "Connect wallet to activate" + #: apps/cowswap-frontend/src/pages/games/MevSlicer/index.tsx msgid "sandwich-icon" msgstr "sandwich-icon" @@ -1630,6 +1643,10 @@ msgstr "s" msgid "Order Cancelled" msgstr "Order Cancelled" +#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx +#~ msgid "Swap once to activate." +#~ msgstr "Swap once to activate." + #: apps/cowswap-frontend/src/modules/accountProxy/containers/InvalidCoWShedSetup/index.tsx msgid "Please contact CoW Swap support!" msgstr "Please contact CoW Swap support!" @@ -2082,8 +2099,8 @@ msgid "Unknown" msgstr "Unknown" #: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalCodeLinking.tsx -msgid "Connect to verify code" -msgstr "Connect to verify code" +#~ msgid "Connect to verify code" +#~ msgstr "Connect to verify code" #: apps/cowswap-frontend/src/common/pure/AddressInputPanel/hooks/useReceiverPlaceholder.ts msgid "Wallet Address or ENS name" @@ -3504,6 +3521,10 @@ msgstr "Your order expired. This could be due to gas spikes, volatile prices, or msgid "Not now" msgstr "Not now" +#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx +msgid "Start earning rewards when you trade." +msgstr "Start earning rewards when you trade." + #: apps/cowswap-frontend/src/modules/ordersTable/pure/OrdersTable/Content/UnsupportedNetwork/OrdersTableUnsupportedNetworkContent.tsx #: apps/cowswap-frontend/src/pages/Account/Tokens/TokensOverview.tsx msgid "Unsupported network" @@ -5421,9 +5442,7 @@ msgstr "Transaction {errorType}" msgid "Price impact <0>unknown - trade carefully" msgstr "Price impact <0>unknown - trade carefully" -#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalUnsupported.tsx #: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderOnboard.tsx -#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/AffiliateTradeCodeForm.tsx msgid "Earn while you trade" msgstr "Earn while you trade" @@ -5802,6 +5821,10 @@ msgstr "Orders on CoW Swap can either be market orders (which fill at the market msgid "at least" msgstr "at least" +#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx +msgid "Earn <0>{rewardAmount} per <1>{triggerVolume} of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet." +msgstr "Earn <0>{rewardAmount} per <1>{triggerVolume} of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet." + #: apps/cowswap-frontend/src/modules/twap/utils/deadlinePartsDisplay.ts msgid "m" msgstr "m" @@ -6460,6 +6483,10 @@ msgstr "Swap costs are at least {formattedFeePercentage}% of the swap amount" msgid "Limit orders on CoW Swap capture surplus - so if the price moves in your favor, you're likely to get more than you asked for." msgstr "Limit orders on CoW Swap capture surplus - so if the price moves in your favor, you're likely to get more than you asked for." +#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx +msgid "Your friend shared a referral code with you." +msgstr "Your friend shared a referral code with you." + #: apps/cowswap-frontend/src/modules/ordersTable/pure/ReceiptModal/ReceiptModal.modal.tsx msgid "Avg. execution price" msgstr "Avg. execution price" @@ -6857,6 +6884,10 @@ msgstr "Connect signer" msgid "Connect wallet banner" msgstr "Connect wallet banner" +#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx +#~ msgid "Your friend shared a referral code with you. Connect your wallet to activate it and start earning rewards when you trade." +#~ msgstr "Your friend shared a referral code with you. Connect your wallet to activate it and start earning rewards when you trade." + #: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/SettingsDropdown/SettingsDropdown.container.tsx msgid "Enable Partial Approvals" msgstr "Enable Partial Approvals" diff --git a/apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalCodeLinking.tsx b/apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalCodeLinking.tsx index 56bafb87c96..eec9efa4d08 100644 --- a/apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalCodeLinking.tsx +++ b/apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalCodeLinking.tsx @@ -47,7 +47,7 @@ export function AffiliateTraderModalCodeLinking(): ReactNode { const submitButtonLabel = useMemo(() => { if (isVerifying) return t`Checking code...` if (savedCode) return t`Start trading` - if (!account) return t`Connect to verify code` + if (!account) return t`Connect wallet to activate` return t`Verify code` }, [account, isVerifying, savedCode]) diff --git a/apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalUnsupported.tsx b/apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalUnsupported.tsx index 950b7556d85..b2f38c102d8 100644 --- a/apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalUnsupported.tsx +++ b/apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalUnsupported.tsx @@ -14,7 +14,7 @@ export function AffiliateTraderModalUnsupported(): ReactNode { - <Trans>Earn while you trade</Trans> + <Trans>You've been referred - here's your reward</Trans> diff --git a/apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/AffiliateTradeCodeForm.tsx b/apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/AffiliateTradeCodeForm.tsx index e2d8e952b6d..19dd29e4b46 100644 --- a/apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/AffiliateTradeCodeForm.tsx +++ b/apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/AffiliateTradeCodeForm.tsx @@ -80,9 +80,9 @@ export function AffiliateTradeCodeForm({ - <Trans>Earn while you trade</Trans> + <Trans>You've been referred - here's your reward</Trans> - +