Skip to content

Commit

Permalink
chore: remove external from platforms and removed it from select_wall…
Browse files Browse the repository at this point in the history
…et events
  • Loading branch information
tomiir committed Feb 21, 2024
1 parent 3addddf commit af66785
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
9 changes: 1 addition & 8 deletions packages/core/src/utils/TypeUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@ export interface LinkingRecord {

export type ProjectId = string

export type Platform =
| 'mobile'
| 'desktop'
| 'browser'
| 'web'
| 'qrcode'
| 'unsupported'
| 'external'
export type Platform = 'mobile' | 'desktop' | 'browser' | 'web' | 'qrcode' | 'unsupported'

export type ConnectorType = 'EXTERNAL' | 'WALLET_CONNECT' | 'INJECTED' | 'ANNOUNCED' | 'EMAIL'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseError, ConnectorType, Platform } from '@web3modal/core'
import type { BaseError } from '@web3modal/core'
import {
ConnectionController,
EventsController,
Expand All @@ -10,24 +10,20 @@ import {
import { customElement } from '@web3modal/ui'
import { W3mConnectingWidget } from '../../utils/w3m-connecting-widget/index.js'

const platformMap = {
INJECTED: 'browser',
ANNOUNCED: 'browser'
} as Record<ConnectorType, Platform>

@customElement('w3m-connecting-external-view')
export class W3mConnectingExternalView extends W3mConnectingWidget {
public constructor() {
super()
if (!this.connector) {
throw new Error('w3m-connecting-view: No connector provided')
}

EventsController.sendEvent({
type: 'track',
event: 'SELECT_WALLET',
properties: {
name: this.connector.name ?? 'Unknown',
platform: platformMap[this.connector.type] ?? 'external'
platform: 'browser'
}
})
this.onConnect = this.onConnectProxy.bind(this)
Expand Down

0 comments on commit af66785

Please sign in to comment.