@interchain-kit/store 0.6.0 → 0.6.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/esm/store/index.js +14 -0
- package/package.json +2 -2
- package/store/index.js +14 -0
package/esm/store/index.js
CHANGED
|
@@ -65,6 +65,20 @@ export class InterchainStore {
|
|
|
65
65
|
else {
|
|
66
66
|
this.addChainWalletState(walletName, chainName, state);
|
|
67
67
|
}
|
|
68
|
+
switch (state.walletState) {
|
|
69
|
+
case WalletState.Connected:
|
|
70
|
+
this.setCurrentWalletName(walletName);
|
|
71
|
+
this.setCurrentChainName(chainName);
|
|
72
|
+
break;
|
|
73
|
+
case WalletState.Disconnected:
|
|
74
|
+
if (this.state.currentWalletName === walletName && this.state.currentChainName === chainName) {
|
|
75
|
+
// TODO: for supporting multiple wallet connections,
|
|
76
|
+
// we should set these to the previous instead of clearing
|
|
77
|
+
this.setCurrentWalletName('');
|
|
78
|
+
this.setCurrentChainName('');
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
68
82
|
}
|
|
69
83
|
// 添加新的 chain wallet state
|
|
70
84
|
addChainWalletState(walletName, chainName, state) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interchain-kit/store",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"author": "Hyperweb <developers@hyperweb.io>",
|
|
5
5
|
"description": "interchain-kit wallet connector store package",
|
|
6
6
|
"main": "index.js",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"watch:dev": "tsc -w -p tsconfig.esm.json & tsc -w"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [],
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "1710902c531e57cd955fa88723680543f0a76707"
|
|
35
35
|
}
|
package/store/index.js
CHANGED
|
@@ -68,6 +68,20 @@ class InterchainStore {
|
|
|
68
68
|
else {
|
|
69
69
|
this.addChainWalletState(walletName, chainName, state);
|
|
70
70
|
}
|
|
71
|
+
switch (state.walletState) {
|
|
72
|
+
case core_1.WalletState.Connected:
|
|
73
|
+
this.setCurrentWalletName(walletName);
|
|
74
|
+
this.setCurrentChainName(chainName);
|
|
75
|
+
break;
|
|
76
|
+
case core_1.WalletState.Disconnected:
|
|
77
|
+
if (this.state.currentWalletName === walletName && this.state.currentChainName === chainName) {
|
|
78
|
+
// TODO: for supporting multiple wallet connections,
|
|
79
|
+
// we should set these to the previous instead of clearing
|
|
80
|
+
this.setCurrentWalletName('');
|
|
81
|
+
this.setCurrentChainName('');
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
71
85
|
}
|
|
72
86
|
// 添加新的 chain wallet state
|
|
73
87
|
addChainWalletState(walletName, chainName, state) {
|