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 +1 -1
- package/src/zanoWallet.ts +5 -3
package/package.json
CHANGED
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
|
-
|
|
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:
|
|
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 (!
|
|
181
|
+
if (!existingWalletValid && this.params.useLocalStorage) {
|
|
180
182
|
this.setWalletCredentials({
|
|
181
183
|
publicKey,
|
|
182
184
|
signature,
|