From 21de91f0bc9e1fc051a5a43f2fb7bb510b3ecef8 Mon Sep 17 00:00:00 2001 From: bluecco Date: Wed, 17 Jan 2024 16:48:38 +0100 Subject: [PATCH] fix: throw UserRejectedRequestError for mobile connector when user reject connection --- src/connectors/argentMobile/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/connectors/argentMobile/index.ts b/src/connectors/argentMobile/index.ts index 7c0b328..cd28c37 100644 --- a/src/connectors/argentMobile/index.ts +++ b/src/connectors/argentMobile/index.ts @@ -9,6 +9,7 @@ import { ConnectorNotConnectedError, ConnectorNotFoundError, UserNotConnectedError, + UserRejectedRequestError, } from "../../errors" import { resetWalletConnect } from "../../helpers/resetWalletConnect" import { @@ -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