@rango-dev/widget-embedded 0.65.1-next.1 → 0.65.1-next.3
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/QueueManager.d.ts.map +1 -1
- package/dist/containers/Wallets/Wallets.d.ts.map +1 -1
- package/dist/hooks/useBootstrap/useBootstrap.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +3 -3
- package/package.json +6 -6
- package/src/QueueManager.tsx +4 -1
- package/src/containers/Wallets/Wallets.tsx +0 -4
- package/src/hooks/useBootstrap/useBootstrap.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.65.1-next.
|
|
3
|
+
"version": "0.65.1-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"@lingui/react": "4.2.1",
|
|
40
40
|
"@rango-dev/internal-blockchains": "^0.3.1-next.1",
|
|
41
41
|
"@rango-dev/logging-core": "^0.16.1-next.1",
|
|
42
|
-
"@rango-dev/provider-all": "^0.67.1-next.
|
|
42
|
+
"@rango-dev/provider-all": "^0.67.1-next.2",
|
|
43
43
|
"@rango-dev/queue-manager-core": "^0.36.1-next.0",
|
|
44
|
-
"@rango-dev/queue-manager-rango-preset": "^0.66.1-next.
|
|
45
|
-
"@rango-dev/queue-manager-react": "^0.36.1-next.
|
|
44
|
+
"@rango-dev/queue-manager-rango-preset": "^0.66.1-next.3",
|
|
45
|
+
"@rango-dev/queue-manager-react": "^0.36.1-next.1",
|
|
46
46
|
"@rango-dev/signer-evm": "^0.47.1",
|
|
47
47
|
"@rango-dev/signer-solana": "^0.51.1-next.0",
|
|
48
|
-
"@rango-dev/ui": "^0.67.1-next.
|
|
49
|
-
"@rango-dev/wallets-react": "^0.50.1-next.
|
|
48
|
+
"@rango-dev/ui": "^0.67.1-next.3",
|
|
49
|
+
"@rango-dev/wallets-react": "^0.50.1-next.3",
|
|
50
50
|
"bignumber.js": "^9.1.1",
|
|
51
51
|
"copy-to-clipboard": "^3.3.3",
|
|
52
52
|
"crypto-browserify": "^3.12.1",
|
package/src/QueueManager.tsx
CHANGED
|
@@ -112,7 +112,10 @@ function QueueManager(props: PropsWithChildren<{ apiKey?: string }>) {
|
|
|
112
112
|
queuesDefs={[swapQueueDef]}
|
|
113
113
|
context={context}
|
|
114
114
|
onPersistedDataLoaded={(manager) => {
|
|
115
|
-
|
|
115
|
+
// Other tabs only show swaps; the active one checks them, also when a tab becomes active (`useQueueManager`).
|
|
116
|
+
if (useUiStore.getState().isActiveTab) {
|
|
117
|
+
checkWaitingForNetworkChange(manager);
|
|
118
|
+
}
|
|
116
119
|
}}
|
|
117
120
|
isPaused={!isActiveTab}>
|
|
118
121
|
{props.children}
|
|
@@ -15,7 +15,6 @@ import React, { createContext, useEffect, useMemo, useRef } from 'react';
|
|
|
15
15
|
import { useWalletProviders } from '../../hooks/useWalletProviders';
|
|
16
16
|
import { eventEmitter } from '../../services/eventEmitter';
|
|
17
17
|
import { AppStoreProvider, useAppStore } from '../../store/AppStore';
|
|
18
|
-
import { useUiStore } from '../../store/ui';
|
|
19
18
|
|
|
20
19
|
import { useUpdates } from './useUpdates';
|
|
21
20
|
import { propagateEvents } from './Wallets.helpers';
|
|
@@ -70,8 +69,6 @@ function Main(props: PropsWithChildren<PropTypes>) {
|
|
|
70
69
|
}
|
|
71
70
|
}, [props.config, fetchStatus]);
|
|
72
71
|
|
|
73
|
-
const isActiveTab = useUiStore.use.isActiveTab();
|
|
74
|
-
|
|
75
72
|
const handlers = useMemo(
|
|
76
73
|
() => ({
|
|
77
74
|
onConnectWallet: (handler: OnWalletConnectHandler) => {
|
|
@@ -104,7 +101,6 @@ function Main(props: PropsWithChildren<PropTypes>) {
|
|
|
104
101
|
propagateEvents(props.onUpdateState, eventParams);
|
|
105
102
|
}
|
|
106
103
|
}}
|
|
107
|
-
autoConnect={!!isActiveTab}
|
|
108
104
|
configs={{
|
|
109
105
|
wallets: config.wallets,
|
|
110
106
|
walletOptions: {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
unsubscribeRefuelQuoteStore,
|
|
15
15
|
unsubscribeSwapQuoteStore,
|
|
16
16
|
} from '../../store/quote';
|
|
17
|
-
import { tabManager } from '../../store/ui';
|
|
17
|
+
import { tabManager, useUiStore } from '../../store/ui';
|
|
18
18
|
import { useForceAutoConnect } from '../useForceAutoConnect';
|
|
19
19
|
import { useSubscribeToWidgetEvents } from '../useSubscribeToWidgetEvents';
|
|
20
20
|
import { useSyncNotifications } from '../useSyncNotifications';
|
|
@@ -37,8 +37,11 @@ export function useBootstrap() {
|
|
|
37
37
|
useEffect(() => () => unsubscribeSwapQuoteStore(), []);
|
|
38
38
|
useEffect(() => () => unsubscribeRefuelQuoteStore(), []);
|
|
39
39
|
|
|
40
|
+
const isActiveTab = useUiStore.use.isActiveTab();
|
|
41
|
+
|
|
40
42
|
// At the moment, we only detect the disconnection of EVM wallets.
|
|
41
43
|
useQueueManager({
|
|
44
|
+
isActive: isActiveTab,
|
|
42
45
|
lastConnectedWallet,
|
|
43
46
|
clearDisconnectedWallet: () => {
|
|
44
47
|
setDisconnectedWallet(undefined);
|