@interchain-kit/react 0.3.0 → 0.3.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.
@@ -39,16 +39,17 @@ export const createInterchainStore = (walletManager) => {
39
39
  },
40
40
  init: async () => {
41
41
  const oldChainWalletStatesMap = new Map(get().chainWalletState.map(cws => [cws.walletName + cws.chainName, cws]));
42
- set(draft => {
43
- draft.chainWalletState = [];
44
- });
45
- wallets.forEach(wallet => {
46
- chains.forEach(chain => {
42
+ // should remove wallet that already disconnected ,for hydrain back from localstorage
43
+ // const oldChainWalletStateMap = new Map()
44
+ // get().chainWalletState.forEach(cws => {
45
+ // if(cws.walletState === WalletState.Connected) {
46
+ // oldChainWalletStateMap.set(cws.walletName + cws.chainName, cws)
47
+ // }
48
+ // })
49
+ get().wallets.forEach(wallet => {
50
+ get().chains.forEach(chain => {
47
51
  set(draft => {
48
- if (oldChainWalletStatesMap.has(wallet.info.name + chain.chainName)) {
49
- draft.chainWalletState.push(oldChainWalletStatesMap.get(wallet.info.name + chain.chainName));
50
- }
51
- else {
52
+ if (!oldChainWalletStatesMap.has(wallet.info.name + chain.chainName)) {
52
53
  draft.chainWalletState.push({
53
54
  chainName: chain.chainName,
54
55
  walletName: wallet.info.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interchain-kit/react",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "author": "Hyperweb <developers@hyperweb.io>",
5
5
  "description": "interchain-kit wallet connector react package",
6
6
  "main": "index.js",
@@ -34,7 +34,7 @@
34
34
  "keywords": [],
35
35
  "dependencies": {
36
36
  "@chain-registry/v2-types": "^0.53.40",
37
- "@interchain-kit/core": "0.3.0",
37
+ "@interchain-kit/core": "0.3.1",
38
38
  "@interchain-ui/react": "1.26.1",
39
39
  "@interchainjs/cosmos": "1.11.2",
40
40
  "@interchainjs/cosmos-types": "1.11.2",
@@ -63,5 +63,5 @@
63
63
  "react": "^19.0.0",
64
64
  "react-dom": "^19.0.0"
65
65
  },
66
- "gitHead": "2fa62ae0dbeb2833b55d59c0cfe8446d1c7a7b06"
66
+ "gitHead": "d0add33b6b238d50dfd9c20ba44fd558a738eea8"
67
67
  }
package/store/store.js CHANGED
@@ -42,16 +42,17 @@ const createInterchainStore = (walletManager) => {
42
42
  },
43
43
  init: async () => {
44
44
  const oldChainWalletStatesMap = new Map(get().chainWalletState.map(cws => [cws.walletName + cws.chainName, cws]));
45
- set(draft => {
46
- draft.chainWalletState = [];
47
- });
48
- wallets.forEach(wallet => {
49
- chains.forEach(chain => {
45
+ // should remove wallet that already disconnected ,for hydrain back from localstorage
46
+ // const oldChainWalletStateMap = new Map()
47
+ // get().chainWalletState.forEach(cws => {
48
+ // if(cws.walletState === WalletState.Connected) {
49
+ // oldChainWalletStateMap.set(cws.walletName + cws.chainName, cws)
50
+ // }
51
+ // })
52
+ get().wallets.forEach(wallet => {
53
+ get().chains.forEach(chain => {
50
54
  set(draft => {
51
- if (oldChainWalletStatesMap.has(wallet.info.name + chain.chainName)) {
52
- draft.chainWalletState.push(oldChainWalletStatesMap.get(wallet.info.name + chain.chainName));
53
- }
54
- else {
55
+ if (!oldChainWalletStatesMap.has(wallet.info.name + chain.chainName)) {
55
56
  draft.chainWalletState.push({
56
57
  chainName: chain.chainName,
57
58
  walletName: wallet.info.name,