@rango-dev/widget-embedded 0.44.2-next.1 → 0.44.2-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.44.2-next.1",
3
+ "version": "0.44.2-next.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -13,6 +13,7 @@ import { SameTokensWarning } from '../components/SameTokensWarning';
13
13
  import { SlippageWarningsAndErrors } from '../components/SlippageWarningsAndErrors/SlippageWarningsAndErrors';
14
14
  import { SwapMetrics } from '../components/SwapMetrics';
15
15
  import { navigationRoutes } from '../constants/navigationRoutes';
16
+ import { SLIPPAGES } from '../constants/swapSettings';
16
17
  import { ExpandedQuotes } from '../containers/ExpandedQuotes';
17
18
  import { Inputs } from '../containers/Inputs';
18
19
  import { QuoteInfo } from '../containers/QuoteInfo';
@@ -136,10 +137,15 @@ export function Home() {
136
137
  };
137
138
 
138
139
  const onChangeSlippage = (slippage: number | null) => {
139
- if (slippage) {
140
+ if (!slippage) {
141
+ return;
142
+ }
143
+ if (SLIPPAGES.includes(slippage)) {
140
144
  setSlippage(slippage);
141
145
  setCustomSlippage(null);
146
+ return;
142
147
  }
148
+ setCustomSlippage(slippage);
143
149
  };
144
150
 
145
151
  useEffect(() => {