Skip to content

Commit

Permalink
Merge pull request #58 from argentlabs/fix/argent-mobile-isPreauthorized
Browse files Browse the repository at this point in the history
fix: implement argent mobile connector isPreauthorized method
  • Loading branch information
bluecco authored Jan 15, 2024
2 parents 5e1f142 + 5186278 commit 67bf972
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/connectors/argentMobile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export class ArgentMobileConnector extends Connector {
}

async ready(): Promise<boolean> {
// 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
}
Expand Down
3 changes: 2 additions & 1 deletion src/connectors/argentMobile/modal/starknet/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ export class StarknetAdapter
}

async isPreauthorized(): Promise<boolean> {
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) => {
Expand Down

0 comments on commit 67bf972

Please sign in to comment.