From be7a196eeb068f1955be9ff83b0c04a320910e7a Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Thu, 7 Apr 2016 12:18:37 -0700 Subject: [PATCH] fix(tracking): uid uses draftClientId --- .../link-tracking/lib/link-tracking-composer-extension.es6 | 3 +-- internal_packages/open-tracking/lib/open-tracking-button.jsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal_packages/link-tracking/lib/link-tracking-composer-extension.es6 b/internal_packages/link-tracking/lib/link-tracking-composer-extension.es6 index 510b7418c..624e1b84c 100644 --- a/internal_packages/link-tracking/lib/link-tracking-composer-extension.es6 +++ b/internal_packages/link-tracking/lib/link-tracking-composer-extension.es6 @@ -1,4 +1,3 @@ -import uuid from 'node-uuid'; import { ComposerExtension, Actions, @@ -23,7 +22,7 @@ export default class LinkTrackingComposerExtension extends ComposerExtension { if (metadata) { const draftBody = new DraftBody(draft); const links = []; - const messageUid = uuid.v4().replace(/-/g, ""); + const messageUid = draft.clientId; // loop through all elements, replace with redirect links and save // mappings. The links component of the path is an index of the link array. diff --git a/internal_packages/open-tracking/lib/open-tracking-button.jsx b/internal_packages/open-tracking/lib/open-tracking-button.jsx index def0e050c..a65e7fc96 100644 --- a/internal_packages/open-tracking/lib/open-tracking-button.jsx +++ b/internal_packages/open-tracking/lib/open-tracking-button.jsx @@ -2,7 +2,6 @@ import {React, APIError, NylasAPI} from 'nylas-exports' import {MetadataComposerToggleButton} from 'nylas-component-kit' import {PLUGIN_ID, PLUGIN_NAME} from './open-tracking-constants' -import uuid from 'node-uuid'; export default class OpenTrackingButton extends React.Component { static displayName = 'OpenTrackingButton'; @@ -25,7 +24,7 @@ export default class OpenTrackingButton extends React.Component { render() { const enabledValue = { - uid: uuid.v4().replace(/-/g, ""), + uid: this.props.draftClientId, open_count: 0, open_data: [], };