zano_web3 3.1.0 → 3.2.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": "zano_web3",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/zanoWallet.ts CHANGED
@@ -116,7 +116,9 @@ class ZanoWallet {
116
116
 
117
117
  const existingWallet = this.params.useLocalStorage ? this.getSavedWalletCredentials() : undefined;
118
118
 
119
- if (existingWallet && existingWallet.address === walletData.address) {
119
+ const existingWalletValid = existingWallet && existingWallet.address === walletData.address;
120
+
121
+ if (existingWalletValid) {
120
122
  nonce = existingWallet.nonce;
121
123
  signature = existingWallet.signature;
122
124
  publicKey = existingWallet.publicKey;
@@ -147,7 +149,7 @@ class ZanoWallet {
147
149
  signature,
148
150
  pkey: publicKey,
149
151
  message: nonce,
150
- isSavedData: !!existingWallet
152
+ isSavedData: existingWalletValid
151
153
  }
152
154
 
153
155
  if (this.params.onLocalConnectEnd) {
@@ -176,7 +178,7 @@ class ZanoWallet {
176
178
  return this.handleError({ message: result.error });
177
179
  }
178
180
 
179
- if (!existingWallet && this.params.useLocalStorage) {
181
+ if (!existingWalletValid && this.params.useLocalStorage) {
180
182
  this.setWalletCredentials({
181
183
  publicKey,
182
184
  signature,