Skip to content

Commit

Permalink
feat: add name to connect event. Remove external type and replace wit…
Browse files Browse the repository at this point in the history
…h browser
  • Loading branch information
tomiir committed Feb 15, 2024
1 parent 937edb0 commit d414a31
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/utils/TypeUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ export type Event =
type: 'track'
event: 'CONNECT_SUCCESS'
properties: {
method: 'qrcode' | 'mobile' | 'external' | 'browser' | 'email'
method: 'qrcode' | 'mobile' | 'browser' | 'email'
name: string
}
}
| {
Expand Down
3 changes: 2 additions & 1 deletion packages/core/tests/controllers/AssetController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ describe('AssetController', () => {
walletImages: {},
networkImages: {},
connectorImages: {},
tokenImages: {}
tokenImages: {},
currencyImages: {}
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ describe('TransactionsController', () => {
transactionsByYear: {},
loading: false,
empty: false,
next: undefined
next: undefined,
coinbaseTransactions: []
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class W3mConnectingWcBrowser extends W3mConnectingWidget {
EventsController.sendEvent({
type: 'track',
event: 'CONNECT_SUCCESS',
properties: { method: 'browser' }
properties: { method: 'browser', name: this.wallet?.name || 'Unknown' }
})
} catch (error) {
EventsController.sendEvent({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class W3mConnectingExternalView extends W3mConnectingWidget {
EventsController.sendEvent({
type: 'track',
event: 'CONNECT_SUCCESS',
properties: { method: 'external' }
properties: { method: 'browser', name: this.connector.name || 'Unknown' }
})
}
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion packages/scaffold/src/views/w3m-connecting-wc-view/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export class W3mConnectingWcView extends LitElement {
type: 'track',
event: 'CONNECT_SUCCESS',
properties: {
method: wcLinking ? 'mobile' : 'qrcode'
method: wcLinking ? 'mobile' : 'qrcode',
name: this.wallet?.name || 'Unknown'
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class W3mEmailVerifyOtpView extends W3mEmailOtpWidget {
EventsController.sendEvent({
type: 'track',
event: 'CONNECT_SUCCESS',
properties: { method: 'email' }
properties: { method: 'email', name: this.emailConnector.name || 'Unknown' }
})
}
} catch (error) {
Expand Down

0 comments on commit d414a31

Please sign in to comment.