@rango-dev/widget-embedded 0.44.2-next.0 → 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/dist/hooks/useStatefulConnect/useStatefulConnect.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/widget-embedded.build.json +1 -1
- package/package.json +2 -2
- package/src/hooks/useStatefulConnect/useStatefulConnect.ts +6 -11
- package/src/pages/Home.tsx +7 -1
package/package.json
CHANGED
|
@@ -7,10 +7,7 @@ import { WalletState } from '@rango-dev/ui';
|
|
|
7
7
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
8
8
|
import { useReducer } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
checkIsWalletPartiallyConnected,
|
|
12
|
-
type ExtendedModalWalletInfo,
|
|
13
|
-
} from '../../utils/wallets';
|
|
10
|
+
import { type ExtendedModalWalletInfo } from '../../utils/wallets';
|
|
14
11
|
|
|
15
12
|
import {
|
|
16
13
|
isStateOnDerivationPathStep,
|
|
@@ -148,14 +145,12 @@ export function useStatefulConnect(): UseStatefulConnect {
|
|
|
148
145
|
}
|
|
149
146
|
}
|
|
150
147
|
|
|
148
|
+
// If the wallet is a hub wallet and it is connected (fully or partially) and it contains more than one namespace, we should display detached modal
|
|
151
149
|
if (!!wallet.isHub) {
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
namespacesState
|
|
157
|
-
);
|
|
158
|
-
if (isPartiallyConnected) {
|
|
150
|
+
const needsNamespace = wallet.properties?.find(
|
|
151
|
+
(item) => item.name === 'namespaces'
|
|
152
|
+
)?.value;
|
|
153
|
+
if (needsNamespace?.data.length && needsNamespace.data.length > 1) {
|
|
159
154
|
dispatch({
|
|
160
155
|
type: 'detached',
|
|
161
156
|
payload: {
|
package/src/pages/Home.tsx
CHANGED
|
@@ -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(() => {
|