Skip to content

Commit

Permalink
fix: throw UserRejectedRequestError for mobile connector when user re…
Browse files Browse the repository at this point in the history
…ject connection
  • Loading branch information
bluecco committed Jan 17, 2024
1 parent e88e55f commit 21de91f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/connectors/argentMobile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ConnectorNotConnectedError,
ConnectorNotFoundError,
UserNotConnectedError,
UserRejectedRequestError,
} from "../../errors"
import { resetWalletConnect } from "../../helpers/resetWalletConnect"
import {
Expand Down Expand Up @@ -195,6 +196,11 @@ export class ArgentMobileConnector extends Connector {

const _wallet = await getStarknetWindowObject(options)

// getStarknetWindowObject returns null when the user rejects the connection
if (!_wallet) {
throw new UserRejectedRequestError()
}

this._wallet = _wallet

// wallet connect rpc enable
Expand Down

0 comments on commit 21de91f

Please sign in to comment.