Skip to content

Commit

Permalink
Merge pull request #59 from argentlabs/fix/argent-mobile-connect-reject
Browse files Browse the repository at this point in the history
fix: throw UserRejectedRequestError for mobile connector when user re…
  • Loading branch information
bluecco authored Jan 17, 2024
2 parents e88e55f + 21de91f commit e2db8ef
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 e2db8ef

Please sign in to comment.