Skip to content

Commit

Permalink
Merge pull request #604 from curvefi/fix/slippage-not-being-set
Browse files Browse the repository at this point in the history
fix: slippage not being set in advanced settings
  • Loading branch information
0xAlunara authored Jan 17, 2025
2 parents cf23f0f + 15aac57 commit c793067
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/main/src/components/PageRouterSwap/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const Page: NextPage = () => {
<BoxHeader className="title-text">
<IconButton testId="hidden" hidden />
{t`Swap`}
<AdvancedSettings stateKey="router" testId="advance-settings" maxSlippage={maxSlippage} />
<AdvancedSettings stateKey="global" testId="advance-settings" maxSlippage={maxSlippage} />
</BoxHeader>

<Box grid gridRowGap={3} padding>
Expand Down
2 changes: 1 addition & 1 deletion apps/main/src/components/PageRouterSwap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ const QuickSwap = ({
<DetailInfoSlippageTolerance
maxSlippage={globalMaxSlippage || routesAndOutput?.maxSlippage}
testId="slippage-tolerance"
stateKey="router"
stateKey="global"
/>
</div>

Expand Down
4 changes: 2 additions & 2 deletions packages/curve-ui-kit/src/features/user-profile/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ type Action = {
/**
* Sets or removes a max slippage value for a given key.
* @param slippage - The slippage value as a string percentage (e.g. "0.1" for 0.1%), or null to remove
* @param key - Optional key to set slippage for (e.g. "router" or chainId-poolId). If omitted, sets slippage to all existing keys.
* @param key - Optional key to set slippage for (e.g. "global" or chainId-poolId). If omitted, sets slippage to all existing keys.
* @returns boolean - True if slippage was successfully set/removed, false if invalid input
* @example
* // Set router slippage to 0.1%
* setMaxSlippage("0.1", "router")
* setMaxSlippage("0.1", "global")
*
* // Remove slippage for specific pool
* setMaxSlippage(null, "1-0x123...")
Expand Down

0 comments on commit c793067

Please sign in to comment.