1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

[FLASK] Add snap update metrics (#15206)

* added snap update metrics

* fixed update event
This commit is contained in:
Hassan Malik 2022-07-22 10:08:43 -04:00 committed by GitHub
parent be47d78475
commit e280204287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1291,6 +1291,21 @@ export default class MetamaskController extends EventEmitter {
},
);
this.controllerMessenger.subscribe(
`${this.snapController.name}:snapUpdated`,
(newSnap, oldVersion) => {
this.metaMetricsController.trackEvent({
event: 'Snap Updated',
category: EVENT.CATEGORIES.SNAPS,
properties: {
snap_id: newSnap.id,
old_version: oldVersion,
new_version: newSnap.version,
},
});
},
);
this.controllerMessenger.subscribe(
`${this.snapController.name}:snapTerminated`,
(truncatedSnap) => {