@rango-dev/widget-embedded 0.44.2-next.0 → 0.44.2-next.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.44.2-next.0",
3
+ "version": "0.44.2-next.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -54,4 +54,4 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  }
57
- }
57
+ }
@@ -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 walletState = state(wallet.type);
153
- const namespacesState = walletState.namespaces;
154
- const isPartiallyConnected = checkIsWalletPartiallyConnected(
155
- wallet,
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: {