@rango-dev/widget-embedded 0.21.1-next.9 → 0.22.1
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/CHANGELOG.md +25 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +0 -1
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteCostDetails.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModal.d.ts.map +1 -1
- package/dist/components/common/ActivateTabModal/ActivateTabModal.d.ts.map +1 -1
- package/dist/components/common/WatermarkedModal/WatermarkedModal.d.ts +5 -0
- package/dist/components/common/WatermarkedModal/WatermarkedModal.d.ts.map +1 -0
- package/dist/components/common/WatermarkedModal/index.d.ts +2 -0
- package/dist/components/common/WatermarkedModal/index.d.ts.map +1 -0
- package/dist/containers/App/App.d.ts.map +1 -1
- package/dist/containers/Widget/Widget.d.ts.map +1 -1
- package/dist/hooks/useFetchApiConfig.d.ts +7 -0
- package/dist/hooks/useFetchApiConfig.d.ts.map +1 -0
- package/dist/hooks/useWalletList.d.ts +0 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/libs/tabManager/tabManager.d.ts +1 -0
- package/dist/libs/tabManager/tabManager.d.ts.map +1 -1
- package/dist/libs/tabManager/tabManager.types.d.ts +1 -0
- package/dist/libs/tabManager/tabManager.types.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/ui.d.ts +7 -2
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +0 -1
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +7 -5
- package/src/components/ConfirmWalletsModal/WalletList.tsx +23 -29
- package/src/components/Layout/Layout.styles.ts +11 -4
- package/src/components/Layout/Layout.tsx +26 -22
- package/src/components/Layout/Layout.types.ts +0 -1
- package/src/components/Quote/QuoteCostDetails.tsx +3 -3
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +4 -3
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +5 -3
- package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +4 -4
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +3 -3
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +3 -29
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +3 -3
- package/src/components/WalletModal/WalletModal.tsx +4 -3
- package/src/components/common/ActivateTabModal/ActivateTabModal.tsx +9 -3
- package/src/components/common/WatermarkedModal/WatermarkedModal.tsx +18 -0
- package/src/components/common/WatermarkedModal/index.ts +1 -0
- package/src/containers/App/App.tsx +3 -1
- package/src/containers/Widget/Widget.tsx +3 -2
- package/src/containers/WidgetInfo/WidgetInfo.tsx +2 -2
- package/src/hooks/useFetchApiConfig.ts +33 -0
- package/src/hooks/useWalletList.ts +4 -20
- package/src/libs/tabManager/tabManager.ts +4 -1
- package/src/libs/tabManager/tabManager.types.ts +1 -0
- package/src/pages/Home.tsx +0 -1
- package/src/pages/WalletsPage.tsx +18 -24
- package/src/store/ui.ts +9 -5
- package/src/utils/wallets.ts +0 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ModalPropTypes } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
|
-
import { Modal } from '@rango-dev/ui';
|
|
4
3
|
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
5
4
|
import React from 'react';
|
|
6
5
|
|
|
7
6
|
import { WIDGET_UI_ID } from '../../constants';
|
|
7
|
+
import { WatermarkedModal } from '../common/WatermarkedModal';
|
|
8
8
|
|
|
9
9
|
import { CancelContent } from './SwapDetailsModal.Cancel';
|
|
10
10
|
import { DeleteContent } from './SwapDetailsModal.Delete';
|
|
@@ -28,7 +28,7 @@ export function SwapDetailsModal(props: ModalPropTypes) {
|
|
|
28
28
|
state === PendingSwapNetworkStatus.NetworkChanged;
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
|
-
<
|
|
31
|
+
<WatermarkedModal
|
|
32
32
|
open={!!state}
|
|
33
33
|
onClose={onClose}
|
|
34
34
|
container={
|
|
@@ -52,6 +52,6 @@ export function SwapDetailsModal(props: ModalPropTypes) {
|
|
|
52
52
|
{state === 'cancel' && (
|
|
53
53
|
<CancelContent onClose={onClose} onCancel={onCancel} />
|
|
54
54
|
)}
|
|
55
|
-
</
|
|
55
|
+
</WatermarkedModal>
|
|
56
56
|
);
|
|
57
57
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { PropTypes } from './WalletModal.types';
|
|
2
2
|
|
|
3
|
-
import { Divider
|
|
3
|
+
import { Divider } from '@rango-dev/ui';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
6
|
import { WIDGET_UI_ID } from '../../constants';
|
|
7
|
+
import { WatermarkedModal } from '../common/WatermarkedModal';
|
|
7
8
|
|
|
8
9
|
import { ModalContent } from './WalletModalContent';
|
|
9
10
|
|
|
@@ -11,7 +12,7 @@ export function WalletModal(props: PropTypes) {
|
|
|
11
12
|
const { open, onClose, ...otherProps } = props;
|
|
12
13
|
|
|
13
14
|
return (
|
|
14
|
-
<
|
|
15
|
+
<WatermarkedModal
|
|
15
16
|
open={open}
|
|
16
17
|
onClose={onClose}
|
|
17
18
|
container={
|
|
@@ -19,6 +20,6 @@ export function WalletModal(props: PropTypes) {
|
|
|
19
20
|
}>
|
|
20
21
|
<ModalContent {...otherProps} />
|
|
21
22
|
<Divider direction="vertical" size={32} />
|
|
22
|
-
</
|
|
23
|
+
</WatermarkedModal>
|
|
23
24
|
);
|
|
24
25
|
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import type { PropTypes } from './ActivateTabModal.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { Button, Divider, MessageBox
|
|
4
|
+
import { Button, Divider, MessageBox } from '@rango-dev/ui';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { getContainer } from '../../../utils/common';
|
|
8
|
+
import { WatermarkedModal } from '../WatermarkedModal';
|
|
8
9
|
|
|
9
10
|
export function ActivateTabModal(props: PropTypes) {
|
|
10
11
|
const { open, onClose, onConfirm } = props;
|
|
12
|
+
|
|
11
13
|
return (
|
|
12
|
-
<
|
|
14
|
+
<WatermarkedModal
|
|
15
|
+
open={open}
|
|
16
|
+
dismissible
|
|
17
|
+
onClose={onClose}
|
|
18
|
+
container={getContainer()}>
|
|
13
19
|
<MessageBox
|
|
14
20
|
title={i18n.t('Activate current tab')}
|
|
15
21
|
type="warning"
|
|
@@ -26,6 +32,6 @@ export function ActivateTabModal(props: PropTypes) {
|
|
|
26
32
|
{i18n.t('Confirm')}
|
|
27
33
|
</Button>
|
|
28
34
|
</MessageBox>
|
|
29
|
-
</
|
|
35
|
+
</WatermarkedModal>
|
|
30
36
|
);
|
|
31
37
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModalPropTypes } from '@rango-dev/ui';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Modal } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { useUiStore } from '../../../store/ui';
|
|
8
|
+
|
|
9
|
+
export function WatermarkedModal(props: PropsWithChildren<ModalPropTypes>) {
|
|
10
|
+
const { watermark } = useUiStore();
|
|
11
|
+
|
|
12
|
+
const hasWatermark = watermark === 'FULL';
|
|
13
|
+
return (
|
|
14
|
+
<Modal hasWatermark={hasWatermark} {...props}>
|
|
15
|
+
{props.children}
|
|
16
|
+
</Modal>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WatermarkedModal } from './WatermarkedModal';
|
|
@@ -7,6 +7,7 @@ import { AppRouter } from '../../components/AppRouter';
|
|
|
7
7
|
import { AppRoutes } from '../../components/AppRoutes';
|
|
8
8
|
import { WidgetEvents } from '../../components/WidgetEvents';
|
|
9
9
|
import { globalFont } from '../../globalStyles';
|
|
10
|
+
import { useFetchApiConfig } from '../../hooks/useFetchApiConfig';
|
|
10
11
|
import { useLanguage } from '../../hooks/useLanguage';
|
|
11
12
|
import { useTheme } from '../../hooks/useTheme';
|
|
12
13
|
import { useAppStore } from '../../store/AppStore';
|
|
@@ -25,10 +26,11 @@ export function Main() {
|
|
|
25
26
|
useState<string>('');
|
|
26
27
|
const [disconnectedWallet, setDisconnectedWallet] = useState<WalletType>();
|
|
27
28
|
const widgetContext = useContext(WidgetContext);
|
|
28
|
-
|
|
29
|
+
const { fetchApiConfig } = useFetchApiConfig();
|
|
29
30
|
useEffect(() => {
|
|
30
31
|
void useNotificationStore.persist.rehydrate();
|
|
31
32
|
widgetContext.onConnectWallet(setLastConnectedWalletWithNetwork);
|
|
33
|
+
void fetchApiConfig().catch(console.log);
|
|
32
34
|
}, []);
|
|
33
35
|
|
|
34
36
|
return (
|
|
@@ -4,13 +4,14 @@ import type { PropsWithChildren } from 'react';
|
|
|
4
4
|
import React, { useEffect } from 'react';
|
|
5
5
|
|
|
6
6
|
import { DEFAULT_CONFIG } from '../../store/slices/config';
|
|
7
|
-
import {
|
|
7
|
+
import { tabManager } from '../../store/ui';
|
|
8
8
|
import { Main } from '../App';
|
|
9
9
|
import { WidgetProvider } from '../WidgetProvider';
|
|
10
10
|
|
|
11
11
|
export function Widget(props: PropsWithChildren<WidgetProps>) {
|
|
12
12
|
useEffect(() => {
|
|
13
|
-
|
|
13
|
+
tabManager.init();
|
|
14
|
+
return tabManager.destroy;
|
|
14
15
|
}, []);
|
|
15
16
|
|
|
16
17
|
if (!props.config?.externalWallets) {
|
|
@@ -7,7 +7,7 @@ import { useLanguage } from '../../hooks/useLanguage';
|
|
|
7
7
|
import { useAppStore } from '../../store/AppStore';
|
|
8
8
|
import { useNotificationStore } from '../../store/notification';
|
|
9
9
|
import { useQuoteStore } from '../../store/quote';
|
|
10
|
-
import {
|
|
10
|
+
import { tabManager, useUiStore } from '../../store/ui';
|
|
11
11
|
import { useWalletsStore } from '../../store/wallets';
|
|
12
12
|
import { calculateWalletUsdValue } from '../../utils/wallets';
|
|
13
13
|
|
|
@@ -36,7 +36,7 @@ export function WidgetInfo(props: React.PropsWithChildren) {
|
|
|
36
36
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
37
37
|
const value: WidgetInfoContextInterface = {
|
|
38
38
|
isActiveTab,
|
|
39
|
-
setCurrentTabAsActive,
|
|
39
|
+
setCurrentTabAsActive: tabManager.forceClaim,
|
|
40
40
|
history,
|
|
41
41
|
wallets: {
|
|
42
42
|
isLoading,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useUiStore } from '../store/ui';
|
|
2
|
+
import { getConfig } from '../utils/configs';
|
|
3
|
+
|
|
4
|
+
export type Watermark = 'NONE' | 'FULL';
|
|
5
|
+
|
|
6
|
+
type ConfigResponse = {
|
|
7
|
+
config: {
|
|
8
|
+
watermark: Watermark;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
interface UseFetchApiConfig {
|
|
13
|
+
fetchApiConfig: () => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function useFetchApiConfig(): UseFetchApiConfig {
|
|
17
|
+
const { setWatermark } = useUiStore();
|
|
18
|
+
|
|
19
|
+
const fetchApiConfig: UseFetchApiConfig['fetchApiConfig'] = async () => {
|
|
20
|
+
const response = await fetch(
|
|
21
|
+
`${getConfig('BASE_URL')}/meta/dapp/config?apiKey=${getConfig('API_KEY')}`
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
throw new Error(`Request failed with status: ${response.status} `);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const data: ConfigResponse = await response.json();
|
|
29
|
+
|
|
30
|
+
setWatermark(data.config.watermark);
|
|
31
|
+
};
|
|
32
|
+
return { fetchApiConfig };
|
|
33
|
+
}
|
|
@@ -9,13 +9,12 @@ import {
|
|
|
9
9
|
type WalletType,
|
|
10
10
|
WalletTypes,
|
|
11
11
|
} from '@rango-dev/wallets-shared';
|
|
12
|
-
import {
|
|
12
|
+
import { useEffect, useState } from 'react';
|
|
13
13
|
|
|
14
14
|
import { useAppStore } from '../store/AppStore';
|
|
15
15
|
import { useWalletsStore } from '../store/wallets';
|
|
16
16
|
import { configWalletsToWalletName } from '../utils/providers';
|
|
17
17
|
import {
|
|
18
|
-
hashWalletsState,
|
|
19
18
|
isExperimentalChain,
|
|
20
19
|
mapWalletTypesToWalletInfo,
|
|
21
20
|
sortWalletsBasedOnConnectionState,
|
|
@@ -40,7 +39,6 @@ export function useWalletList(params: Params) {
|
|
|
40
39
|
const { state, disconnect, getWalletInfo, connect } = useWallets();
|
|
41
40
|
const { connectedWallets } = useWalletsStore();
|
|
42
41
|
const blockchains = useAppStore().blockchains();
|
|
43
|
-
const componentWillUnmount = useRef(false);
|
|
44
42
|
|
|
45
43
|
/** It can be what has been set by widget config or as a fallback we use all the supported wallets by our library */
|
|
46
44
|
const listAvailableWalletTypes =
|
|
@@ -89,34 +87,21 @@ export function useWalletList(params: Params) {
|
|
|
89
87
|
}
|
|
90
88
|
};
|
|
91
89
|
|
|
92
|
-
const disconnectConnectingWallets =
|
|
90
|
+
const disconnectConnectingWallets = () => {
|
|
93
91
|
const connectingWallets =
|
|
94
92
|
wallets?.filter((wallet) => wallet.state === WalletState.CONNECTING) ||
|
|
95
93
|
[];
|
|
96
94
|
for (const wallet of connectingWallets) {
|
|
97
95
|
void disconnect(wallet.type);
|
|
98
96
|
}
|
|
99
|
-
}
|
|
97
|
+
};
|
|
100
98
|
|
|
101
|
-
/*
|
|
102
|
-
* The order of useEffects is crucial.
|
|
103
|
-
* 1- The first useEffect for componentWillUnmount sets its value to true
|
|
104
|
-
*/
|
|
105
99
|
useEffect(() => {
|
|
106
100
|
return () => {
|
|
107
|
-
|
|
101
|
+
disconnectConnectingWallets();
|
|
108
102
|
};
|
|
109
103
|
}, []);
|
|
110
104
|
|
|
111
|
-
// 2- The second useEffect checks if componentWillUnmount is true then it disconnects connecting wallets
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
return () => {
|
|
114
|
-
if (componentWillUnmount.current) {
|
|
115
|
-
disconnectConnectingWallets();
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}, [disconnectConnectingWallets]);
|
|
119
|
-
|
|
120
105
|
/*
|
|
121
106
|
* Atm, we only support default injected wallet for the EVM
|
|
122
107
|
* so we show default wallet when there is no other evm wallet installed
|
|
@@ -156,6 +141,5 @@ export function useWalletList(params: Params) {
|
|
|
156
141
|
),
|
|
157
142
|
error,
|
|
158
143
|
handleClick,
|
|
159
|
-
disconnectConnectingWallets,
|
|
160
144
|
};
|
|
161
145
|
}
|
|
@@ -18,9 +18,12 @@ export class TabManager implements TabManagerInterface {
|
|
|
18
18
|
this.channel = new BroadcastChannel(CHANNEL_NAME);
|
|
19
19
|
this.tabId = Math.trunc(Math.random() * MAXIMUM_TAB_ID);
|
|
20
20
|
this.events = events;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
init = () => {
|
|
21
24
|
this.initEvents();
|
|
22
25
|
void this.tryClaim();
|
|
23
|
-
}
|
|
26
|
+
};
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
29
|
* This is applicable when a user in an inactive tab seeks to activate that tab.
|
package/src/pages/Home.tsx
CHANGED
|
@@ -35,29 +35,23 @@ export function WalletsPage() {
|
|
|
35
35
|
let modalTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
36
36
|
const isActiveTab = useUiStore.use.isActiveTab();
|
|
37
37
|
|
|
38
|
-
const { list, handleClick, error
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const handleCloseWalletModal = () => {
|
|
58
|
-
disconnectConnectingWallets();
|
|
59
|
-
setOpenModal(false);
|
|
60
|
-
};
|
|
38
|
+
const { list, handleClick, error } = useWalletList({
|
|
39
|
+
config,
|
|
40
|
+
onBeforeConnect: (type) => {
|
|
41
|
+
modalTimerId = setTimeout(() => {
|
|
42
|
+
setOpenModal(true);
|
|
43
|
+
setSelectedWalletType(type);
|
|
44
|
+
}, TIME_TO_IGNORE_MODAL);
|
|
45
|
+
},
|
|
46
|
+
onConnect: () => {
|
|
47
|
+
if (modalTimerId) {
|
|
48
|
+
clearTimeout(modalTimerId);
|
|
49
|
+
}
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
setOpenModal(false);
|
|
52
|
+
}, TIME_TO_CLOSE_MODAL);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
61
55
|
|
|
62
56
|
const selectedWallet = list.find(
|
|
63
57
|
(wallet) => wallet.type === selectedWalletType
|
|
@@ -93,7 +87,7 @@ export function WalletsPage() {
|
|
|
93
87
|
})}
|
|
94
88
|
<WalletModal
|
|
95
89
|
open={!!openModal}
|
|
96
|
-
onClose={
|
|
90
|
+
onClose={() => setOpenModal(false)}
|
|
97
91
|
image={selectedWalletImage}
|
|
98
92
|
state={selectedWalletState}
|
|
99
93
|
error={error}
|
package/src/store/ui.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Watermark } from '../hooks/useFetchApiConfig';
|
|
1
2
|
import type { TabManagerInterface } from '../libs/tabManager';
|
|
2
3
|
|
|
3
4
|
import { create } from 'zustand';
|
|
@@ -10,11 +11,13 @@ interface UiState {
|
|
|
10
11
|
isActiveTab: boolean;
|
|
11
12
|
tabManagerInitiated: boolean;
|
|
12
13
|
showActivateTabModal: boolean;
|
|
14
|
+
watermark: Watermark;
|
|
13
15
|
activateCurrentTab: (
|
|
14
16
|
setCurrentTabAsActive: () => void,
|
|
15
17
|
hasRunningSwaps: boolean
|
|
16
18
|
) => void;
|
|
17
19
|
setShowActivateTabModal: (flag: boolean) => void;
|
|
20
|
+
setWatermark: (watermark: Watermark) => void;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
export const useUiStore = createSelectors(
|
|
@@ -22,6 +25,8 @@ export const useUiStore = createSelectors(
|
|
|
22
25
|
isActiveTab: false,
|
|
23
26
|
tabManagerInitiated: false,
|
|
24
27
|
showActivateTabModal: false,
|
|
28
|
+
watermark: 'NONE',
|
|
29
|
+
fetchingApiConfig: false,
|
|
25
30
|
activateCurrentTab: (setCurrentTabAsActive, hasRunningSwaps) => {
|
|
26
31
|
const { showActivateTabModal } = get();
|
|
27
32
|
|
|
@@ -34,16 +39,15 @@ export const useUiStore = createSelectors(
|
|
|
34
39
|
setShowActivateTabModal: (flag) => {
|
|
35
40
|
set({ showActivateTabModal: flag });
|
|
36
41
|
},
|
|
42
|
+
setWatermark: (watermark) => {
|
|
43
|
+
set({ watermark });
|
|
44
|
+
},
|
|
37
45
|
}))
|
|
38
46
|
);
|
|
39
47
|
|
|
40
|
-
const tabManager: TabManagerInterface = new TabManager({
|
|
48
|
+
export const tabManager: TabManagerInterface = new TabManager({
|
|
41
49
|
onInit: () => useUiStore.setState({ tabManagerInitiated: true }),
|
|
42
50
|
onClaim: () =>
|
|
43
51
|
useUiStore.setState({ isActiveTab: true, showActivateTabModal: false }),
|
|
44
52
|
onRelease: () => useUiStore.setState({ isActiveTab: false }),
|
|
45
53
|
});
|
|
46
|
-
|
|
47
|
-
export const setCurrentTabAsActive = tabManager.forceClaim;
|
|
48
|
-
|
|
49
|
-
export const destroyTabManager = tabManager.destroy;
|
package/src/utils/wallets.ts
CHANGED
|
@@ -551,7 +551,3 @@ export const isFetchingBalance = (
|
|
|
551
551
|
!!connectedWallets.find(
|
|
552
552
|
(wallet) => wallet.chain === blockchain && wallet.loading
|
|
553
553
|
);
|
|
554
|
-
|
|
555
|
-
export function hashWalletsState(walletsInfo: ModalWalletInfo[]) {
|
|
556
|
-
return walletsInfo.map((w) => w.state).join('-');
|
|
557
|
-
}
|