Skip to content

Commit

Permalink
fix: unhandled connection errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tien committed Nov 4, 2024
1 parent 9595562 commit c4c5b86
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/angry-hairs-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"dot-connect": patch
---

Fixed unhandled connection errors causing certain test runners to halt unexpectedly.
6 changes: 5 additions & 1 deletion packages/dot-connect/src/elements/connection-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ export class WalletConnection extends BaseWalletConnection {
} else {
await connectWallet(this.wallet);
}
} catch (error) {
console.error(error);
} finally {
this.pending.value = false;
}
Expand Down Expand Up @@ -309,11 +311,13 @@ export class DeepLinkWalletConnection extends BaseWalletConnection<DeepLinkWalle
try {
this.pending.value = true;
if (this.connected.value) {
disconnectWallet(this.wallet);
await disconnectWallet(this.wallet);
} else {
const { uri } = await this.wallet.initiateConnectionHandshake();
this.#uri.value = uri;
}
} catch (error) {
console.error(error);
} finally {
this.pending.value = false;
}
Expand Down

0 comments on commit c4c5b86

Please sign in to comment.