Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/rotten-bags-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@reown/appkit-scaffold-ui': patch
'@reown/appkit': patch
---

Prevent calling SELECT_WALLET event to be trigerred for AppKit Core
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html } from 'lit'
import { property } from 'lit/decorators.js'
import { ifDefined } from 'lit/directives/if-defined.js'

import {
Expand All @@ -24,19 +25,25 @@ import styles from './styles.js'
export class W3mConnectingWcQrcode extends W3mConnectingWidget {
public static override styles = styles

@property({ type: Boolean }) public basic = false

public constructor() {
super()
window.addEventListener('resize', this.forceUpdate)
}

EventsController.sendEvent({
type: 'track',
event: 'SELECT_WALLET',
properties: {
name: this.wallet?.name ?? 'WalletConnect',
platform: 'qrcode',
displayIndex: this.wallet?.display_index
}
})
public override firstUpdated() {
if (!this.basic) {
EventsController.sendEvent({
type: 'track',
event: 'SELECT_WALLET',
properties: {
name: this.wallet?.name ?? 'WalletConnect',
platform: 'qrcode',
displayIndex: this.wallet?.display_index
}
})
}
}

public override disconnectedCallback() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class W3mConnectingWcBasicView extends LitElement {
}

return html`<wui-flex flexDirection="column" .padding=${['0', '0', '4', '0'] as const}>
<w3m-connecting-wc-view .displayBranding=${false}></w3m-connecting-wc-view>
<w3m-connecting-wc-view ?basic=${true} .displayBranding=${false}></w3m-connecting-wc-view>
<wui-flex flexDirection="column" .padding=${['0', '3', '0', '3'] as const}>
<w3m-all-wallets-widget></w3m-all-wallets-widget>
</wui-flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export class W3mConnectingWcView extends LitElement {

@property({ type: Boolean }) public displayBranding = true

@property({ type: Boolean }) public basic = false

public constructor() {
super()
this.determinePlatforms()
Expand Down Expand Up @@ -204,7 +206,7 @@ export class W3mConnectingWcView extends LitElement {
</w3m-connecting-wc-mobile>
`
case 'qrcode':
return html`<w3m-connecting-wc-qrcode></w3m-connecting-wc-qrcode>`
return html`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`
default:
return html`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,12 @@ describe('W3mConnectingWcQrcode', () => {
properties: { name: WALLET.name, platform: 'qrcode' }
})
})

it('it should not send event if basic is true', async () => {
await fixture(html`<w3m-connecting-wc-qrcode basic></w3m-connecting-wc-qrcode>`)

await new Promise(resolve => setTimeout(resolve, 300))

expect(EventsController.sendEvent).not.toHaveBeenCalled()
})
})
Loading