Skip to content
Snippets Groups Projects
Unverified Commit dd43c53d authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #5164 from paulkaplan/moar-saving-telemetry

Emit projectDidSave for all types of saves, not just file exports
parents 065e5b6d 2429f63e
No related branches found
Tags 0.1.0-prerelease.20200512121336
No related merge requests found
...@@ -251,6 +251,7 @@ const ProjectSaverHOC = function (WrappedComponent) { ...@@ -251,6 +251,7 @@ const ProjectSaverHOC = function (WrappedComponent) {
if (id && this.props.onUpdateProjectThumbnail) { if (id && this.props.onUpdateProjectThumbnail) {
this.storeProjectThumbnail(id); this.storeProjectThumbnail(id);
} }
this.reportTelemetryEvent('projectDidSave');
return response; return response;
}) })
.catch(err => { .catch(err => {
...@@ -291,9 +292,15 @@ const ProjectSaverHOC = function (WrappedComponent) { ...@@ -291,9 +292,15 @@ const ProjectSaverHOC = function (WrappedComponent) {
*/ */
// TODO make a telemetry HOC and move this stuff there // TODO make a telemetry HOC and move this stuff there
reportTelemetryEvent (event) { reportTelemetryEvent (event) {
if (this.props.onProjectTelemetryEvent) { try {
const metadata = collectMetadata(this.props.vm, this.props.reduxProjectTitle, this.props.locale); if (this.props.onProjectTelemetryEvent) {
this.props.onProjectTelemetryEvent(event, metadata); const metadata = collectMetadata(this.props.vm, this.props.reduxProjectTitle, this.props.locale);
this.props.onProjectTelemetryEvent(event, metadata);
}
} catch (e) {
log.error('Telemetry error', event, e);
// This is intentionally fire/forget because a failure
// to report telemetry should not block saving
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment