Skip to content

Commit

Permalink
Removed connecting status
Browse files Browse the repository at this point in the history
  • Loading branch information
nigeon authored and elboletaire committed Sep 20, 2023
1 parent e6c46ff commit fd3c1f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 5 additions & 0 deletions packages/rainbowkit-wallets/src/lib/oAuthWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@ export class oAuthWallet extends localStorageWallet {
this.data = event.data.seed
window.removeEventListener('message', this.handlePopupMessage)
}

if (event.data.error) {
window.removeEventListener('message', this.handlePopupMessage)
throw new Error(event.data.error)
}
}
}
10 changes: 2 additions & 8 deletions packages/rainbowkit-wallets/src/wagmi/localStorageConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class localStorageConnector extends Connector {
protected chainId: number | undefined
protected provider: ethers.providers.BaseProvider | undefined
protected wallet: Wallet | undefined
protected connecting: boolean = false

constructor(config: { chains: Chain[]; options: any }) {
super(config)
Expand All @@ -28,13 +27,9 @@ export class localStorageConnector extends Connector {
async connect() {
this.emit('message', { type: 'connecting' })
try {
if (!this.wallet && !this.connecting) {
this.connecting = true
if (!this.wallet) {
await this.createWallet()
} else if (this.connecting) return

this.connecting = false

}
const account = await this.getAccount()
const provider = await this.getProvider()
const chainId = await this.getChainId()
Expand All @@ -50,7 +45,6 @@ export class localStorageConnector extends Connector {

return cdata
} catch (error) {
this.connecting = false
throw new UserRejectedRequestError(error)
}
}
Expand Down

0 comments on commit fd3c1f0

Please sign in to comment.