From 8eae1f282b387f552ec62ba7af7bd99f47e43717 Mon Sep 17 00:00:00 2001 From: Abhinav Adduri Date: Thu, 27 Jul 2017 09:54:50 -0700 Subject: [PATCH] fixed metrics for sender and recipient --- frontend/src/common.js | 21 +-------------------- frontend/src/download.js | 19 +++++++++++++++++++ frontend/src/upload.js | 20 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/frontend/src/common.js b/frontend/src/common.js index 48724ef7..27e9e5fa 100644 --- a/frontend/src/common.js +++ b/frontend/src/common.js @@ -8,23 +8,4 @@ window.analytics = new testPilotGA({ an: 'Firefox Send', ds: 'web', tid: window.trackerId -}); - -gcmCompliant().catch(err => { - $('#page-one').attr('hidden', true); - $('#download').attr('hidden', true); - sendEvent('sender', 'unsupported', { - cd6: err - }).then(() => { - location.replace('/unsupported'); - }); -}); - -if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 && - parseInt(navigator.userAgent.toLowerCase().match(/firefox\/*([^\n\r]*)\./)[1]) <= 49) { - sendEvent('sender', 'unsupported', { - cd6: 'Unsupported Firefox' - }).then(() => { - location.replace('/unsupported'); - }); -} +}); \ No newline at end of file diff --git a/frontend/src/download.js b/frontend/src/download.js index 224d3731..2268fc86 100644 --- a/frontend/src/download.js +++ b/frontend/src/download.js @@ -8,6 +8,25 @@ const storage = new Storage(localStorage); const $ = require('jquery'); require('jquery-circle-progress'); +gcmCompliant().catch(err => { + $('#page-one').attr('hidden', true); + $('#download').attr('hidden', true); + sendEvent('recipient', 'unsupported', { + cd6: err + }).then(() => { + location.replace('/unsupported'); + }); +}); + +if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 && + parseInt(navigator.userAgent.toLowerCase().match(/firefox\/*([^\n\r]*)\./)[1]) <= 49) { + sendEvent('recipient', 'unsupported', { + cd6: new Error('Firefox is outdated.') + }).then(() => { + location.replace('/unsupported'); + }); +} + const Raven = window.Raven; $(document).ready(function() { diff --git a/frontend/src/upload.js b/frontend/src/upload.js index bb1c3f55..0d283f88 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -11,6 +11,26 @@ const bytes = require('bytes'); const Storage = require('./storage'); const storage = new Storage(localStorage); +gcmCompliant().catch(err => { + $('#page-one').attr('hidden', true); + $('#download').attr('hidden', true); + sendEvent('sender', 'unsupported', { + cd6: err + }).then(() => { + location.replace('/unsupported'); + }); +}); + +if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 && + parseInt(navigator.userAgent.toLowerCase().match(/firefox\/*([^\n\r]*)\./)[1]) <= 49) { + sendEvent('sender', 'unsupported', { + cd6: new Error('Firefox is outdated.') + }).then(() => { + location.replace('/unsupported'); + }); +} + + const $ = require('jquery'); require('jquery-circle-progress');