@sundaeswap/wallet-lite 0.0.32 → 0.0.33
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/dist/cjs/classes/WalletObserver.class.js +19 -19
- package/dist/cjs/classes/WalletObserver.class.js.map +1 -1
- package/dist/esm/classes/WalletObserver.class.js +3 -3
- package/dist/esm/classes/WalletObserver.class.js.map +1 -1
- package/dist/types/classes/WalletObserver.class.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/classes/WalletObserver.class.ts +4 -3
package/package.json
CHANGED
|
@@ -230,8 +230,6 @@ export class WalletObserver<
|
|
|
230
230
|
* @returns {Promise<Cip30WalletApi>} - A promise that resolves to the API instance.
|
|
231
231
|
*/
|
|
232
232
|
syncApi = async (activeWallet?: TSupportedWalletExtensions): Promise<any> => {
|
|
233
|
-
let attempts = 0;
|
|
234
|
-
this.api = undefined;
|
|
235
233
|
if (!activeWallet && !this.activeWallet) {
|
|
236
234
|
throw new Error(
|
|
237
235
|
"A wallet is required to be passed as a parameter, or to be defined in the class."
|
|
@@ -241,8 +239,10 @@ export class WalletObserver<
|
|
|
241
239
|
const selectedWallet =
|
|
242
240
|
activeWallet || (this.activeWallet as TSupportedWalletExtensions);
|
|
243
241
|
|
|
242
|
+
let attempts = 0;
|
|
244
243
|
let shouldContinue = true;
|
|
245
|
-
|
|
244
|
+
|
|
245
|
+
while (shouldContinue) {
|
|
246
246
|
if (attempts === 10) {
|
|
247
247
|
throw new Error(
|
|
248
248
|
"Could not reconnect to the selected wallet. Please check your extension."
|
|
@@ -258,6 +258,7 @@ export class WalletObserver<
|
|
|
258
258
|
|
|
259
259
|
this.api = api;
|
|
260
260
|
this.network = await api.getNetworkId();
|
|
261
|
+
shouldContinue = false;
|
|
261
262
|
} catch (e) {
|
|
262
263
|
if (
|
|
263
264
|
(e as Error)?.message === "user canceled connection" ||
|