Skip to content

Commit

Permalink
fix: change isConnected to connected
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Jun 5, 2024
1 parent efc9ddb commit db3e3ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/scaffold/src/modal/w3m-modal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class W3mModal extends LitElement {

@state() private isSiweEnabled = OptionsController.state.isSiweEnabled

@state() private isConnected = AccountController.state.isConnected
@state() private connected = AccountController.state.isConnected

@state() private loading = ModalController.state.loading

Expand All @@ -49,7 +49,7 @@ export class W3mModal extends LitElement {
this.loading = val
this.onNewAddress(AccountController.state.caipAddress)
}),
AccountController.subscribeKey('isConnected', val => (this.isConnected = val)),
AccountController.subscribeKey('isConnected', val => (this.connected = val)),
AccountController.subscribeKey('caipAddress', val => this.onNewAddress(val)),
OptionsController.subscribeKey('isSiweEnabled', val => (this.isSiweEnabled = val))
)
Expand Down Expand Up @@ -88,7 +88,7 @@ export class W3mModal extends LitElement {
if (this.isSiweEnabled) {
const { SIWEController } = await import('@web3modal/siwe')

if (SIWEController.state.status !== 'success' && this.isConnected) {
if (SIWEController.state.status !== 'success' && this.connected) {
await ConnectionController.disconnect()
}
}
Expand Down Expand Up @@ -165,7 +165,7 @@ export class W3mModal extends LitElement {
}

private async onNewAddress(caipAddress?: CaipAddress) {
if (!this.isConnected || this.loading) {
if (!this.connected || this.loading) {
return
}

Expand Down

0 comments on commit db3e3ea

Please sign in to comment.