@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sundaeswap/wallet-lite",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -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
- while (!this.api && shouldContinue) {
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" ||