mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
Fix unbound metrics track function (#10016)
The new metrics controller has a `trackEvent` function that was being called unbound, so `this` references were undefined. It is now bound early in both places where it is passed in as a parameter.
This commit is contained in:
parent
2bcb219501
commit
f75c3c6f68
@ -287,7 +287,9 @@ export default class MetamaskController extends EventEmitter {
|
||||
),
|
||||
provider: this.provider,
|
||||
blockTracker: this.blockTracker,
|
||||
trackMetaMetricsEvent: this.metaMetricsController.trackEvent,
|
||||
trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind(
|
||||
this.metaMetricsController,
|
||||
),
|
||||
getParticipateInMetrics: () =>
|
||||
this.metaMetricsController.state.participateInMetaMetrics,
|
||||
})
|
||||
@ -1969,7 +1971,9 @@ export default class MetamaskController extends EventEmitter {
|
||||
engine.push(
|
||||
createMethodMiddleware({
|
||||
origin,
|
||||
sendMetrics: this.metaMetricsController.trackEvent,
|
||||
sendMetrics: this.metaMetricsController.trackEvent.bind(
|
||||
this.metaMetricsController,
|
||||
),
|
||||
handleWatchAssetRequest: this.preferencesController.requestWatchAsset.bind(
|
||||
this.preferencesController,
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user