Skip to content

Commit

Permalink
fix: Repair some conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
richtera committed Jan 2, 2025
1 parent 4e63d76 commit 1944b41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/astro-example/src/components/DonateEthers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ watch(amount, validateAmount)
watch(
() => [chainId.value, accounts.value, contextAccounts.value] as [number, Array<`0x${string}`>, Array<`0x${string}`>],
([chainId, accounts, contextAccounts]: [number, Array<`0x${string}`>, Array<`0x${string}`>]) => {
walletConnected.value = accounts.length > 0 && contextAccounts.length > 0
walletConnected.value = accounts.length > 0 && contextAccounts.length > 0 && (chainId === 42 || chainId === 4201)
}
)
function donate() {
Expand Down
6 changes: 3 additions & 3 deletions packages/astro-example/src/components/DonateViem.lit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,17 @@ class DonateWidget extends LitElement {

accountsChanged(_accounts: Array<`0x${string}`>) {
this.accounts = [..._accounts]
this.walletConnected = this.accounts.length > 0 && this.contextAccounts.length > 0
this.walletConnected = this.accounts.length > 0 && this.contextAccounts.length > 0 && (this.chainId === lukso.id || this.chainId === luksoTestnet.id)
}

chainChanged(_chainId: number) {
this.chainId = _chainId
this.walletConnected = this.accounts.length > 0 && this.contextAccounts.length > 0
this.walletConnected = this.accounts.length > 0 && this.contextAccounts.length > 0 && (this.chainId === lukso.id || this.chainId === luksoTestnet.id)
}

contextAccountsChanged(_accounts: Array<`0x${string}`>) {
this.contextAccounts = [..._accounts]
this.walletConnected = this.accounts.length > 0 && this.contextAccounts.length > 0
this.walletConnected = this.accounts.length > 0 && this.contextAccounts.length > 0 && (this.chainId === lukso.id || this.chainId === luksoTestnet.id)
}

async donate() {
Expand Down

0 comments on commit 1944b41

Please sign in to comment.