@rango-dev/widget-embedded 0.41.0 → 0.41.1-next.0

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.41.0",
3
+ "version": "0.41.1-next.0",
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
+ }
@@ -28,28 +28,32 @@ export function useSubscribeToWidgetEvents() {
28
28
 
29
29
  if (shouldRefetchBalance) {
30
30
  const fromWallet = route.wallets[step?.fromBlockchain];
31
- const fromAccount = connectedWallets.find(
32
- (connectedWallet) =>
33
- connectedWallet.address?.toLocaleLowerCase() ===
34
- fromWallet.address?.toLocaleLowerCase() &&
35
- connectedWallet.walletType === fromWallet.walletType &&
36
- connectedWallet.chain === step?.fromBlockchain
37
- );
38
- if (fromAccount) {
39
- void fetchBalances([fromAccount]);
31
+ if (fromWallet) {
32
+ const fromAccount = connectedWallets.find(
33
+ (connectedWallet) =>
34
+ connectedWallet.address?.toLocaleLowerCase() ===
35
+ fromWallet.address?.toLocaleLowerCase() &&
36
+ connectedWallet.walletType === fromWallet.walletType &&
37
+ connectedWallet.chain === step?.fromBlockchain
38
+ );
39
+ if (fromAccount) {
40
+ void fetchBalances([fromAccount]);
41
+ }
40
42
  }
41
43
 
42
44
  if (step?.fromBlockchain !== step?.toBlockchain) {
43
45
  const toWallet = route.wallets[step?.toBlockchain];
44
- const toAccount = connectedWallets.find(
45
- (connectedWallet) =>
46
- connectedWallet.address?.toLocaleLowerCase() ===
47
- toWallet.address?.toLocaleLowerCase() &&
48
- connectedWallet.walletType === toWallet.walletType &&
49
- connectedWallet.chain === step?.toBlockchain
50
- );
51
- if (toAccount) {
52
- void fetchBalances([toAccount]);
46
+ if (toWallet) {
47
+ const toAccount = connectedWallets.find(
48
+ (connectedWallet) =>
49
+ connectedWallet.address?.toLocaleLowerCase() ===
50
+ toWallet.address?.toLocaleLowerCase() &&
51
+ connectedWallet.walletType === toWallet.walletType &&
52
+ connectedWallet.chain === step?.toBlockchain
53
+ );
54
+ if (toAccount) {
55
+ void fetchBalances([toAccount]);
56
+ }
53
57
  }
54
58
  }
55
59
  }