diff --git a/src/connectors/argentMobile/index.ts b/src/connectors/argentMobile/index.ts index 65f5d0c..7c0b328 100644 --- a/src/connectors/argentMobile/index.ts +++ b/src/connectors/argentMobile/index.ts @@ -45,6 +45,9 @@ export class ArgentMobileConnector extends Connector { } async ready(): Promise { + // check if session is valid and retrieve the wallet + // if no sessions, it will show the login modal + await this.ensureWallet() if (!this._wallet) { return false } diff --git a/src/connectors/argentMobile/modal/starknet/adapter.ts b/src/connectors/argentMobile/modal/starknet/adapter.ts index d0fb6f1..66709de 100644 --- a/src/connectors/argentMobile/modal/starknet/adapter.ts +++ b/src/connectors/argentMobile/modal/starknet/adapter.ts @@ -127,7 +127,8 @@ export class StarknetAdapter } async isPreauthorized(): Promise { - throw new Error("Not implemented: .isPreauthorized()") + // check if wc session is valid, if so, return true + return Boolean(this.client.session.getAll().find(this.isValidSession)) } on: ConnectedStarknetWindowObject["on"] = (event, handleEvent) => {