From b9eb653f1f3b1688ff4f4851f6726137f5413d56 Mon Sep 17 00:00:00 2001 From: Abhinav Adduri Date: Thu, 20 Jul 2017 15:20:52 -0700 Subject: [PATCH] linting --- frontend/src/download.js | 10 +++++----- frontend/src/upload.js | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frontend/src/download.js b/frontend/src/download.js index 5258dda2..5203b70f 100644 --- a/frontend/src/download.js +++ b/frontend/src/download.js @@ -28,7 +28,7 @@ $(document).ready(function() { $('.legal-links a, .social-links a, #dl-firefox').click(function(target) { target.preventDefault(); - let metric = findMetric(target.currentTarget.href); + const metric = findMetric(target.currentTarget.href); // record exited event by recipient window.analytics .sendEvent('recipient', 'exited', { @@ -59,7 +59,7 @@ $(document).ready(function() { }); $('#download-btn').click(download); function download() { - let totalDownloads = localStorage.getItem('totalDownloads'); + const totalDownloads = localStorage.getItem('totalDownloads'); localStorage.setItem('totalDownloads', Number(totalDownloads) + 1); const fileReceiver = new FileReceiver(); @@ -67,9 +67,9 @@ $(document).ready(function() { for (let i = 0; i < localStorage.length; i++) { const id = localStorage.key(i); - if (id != 'totalUploads' && - id != 'totalDownloads' && - id != 'referrer') { + if (id !== 'totalUploads' && + id !== 'totalDownloads' && + id !== 'referrer') { unexpiredFiles += 1; } } diff --git a/frontend/src/upload.js b/frontend/src/upload.js index ed7f9297..4810d017 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -33,7 +33,7 @@ $(document).ready(function() { $('.legal-links a, .social-links a, #dl-firefox').click(function(target) { target.preventDefault(); - let metric = findMetric(target.currentTarget.href); + const metric = findMetric(target.currentTarget.href); // record exited event by recipient window.analytics .sendEvent('sender', 'exited', { @@ -134,7 +134,7 @@ $(document).ready(function() { function onUpload(event) { event.preventDefault(); - let totalUploads = localStorage.getItem('totalUploads'); + const totalUploads = localStorage.getItem('totalUploads'); localStorage.setItem('totalUploads', Number(totalUploads) + 1); let file = ''; @@ -239,9 +239,9 @@ $(document).ready(function() { for (let i = 0; i < localStorage.length; i++) { const id = localStorage.key(i); - if (id != 'totalUploads' && - id != 'totalDownloads' && - id != 'referrer') { + if (id !== 'totalUploads' && + id !== 'totalDownloads' && + id !== 'referrer') { unexpiredFiles += 1; } } @@ -347,9 +347,9 @@ $(document).ready(function() { populateFileList(localStorage.getItem(id)); } } else if (xhr.status === 404) { - if (id != 'totalUploads' && - id != 'totalDownloads' && - id != 'referrer') { + if (id !== 'totalUploads' && + id !== 'totalDownloads' && + id !== 'referrer') { localStorage.removeItem(id); } } @@ -505,9 +505,9 @@ $(document).ready(function() { for (let i = 0; i < localStorage.length; i++) { const id = localStorage.key(i); - if (id != 'totalUploads' && - id != 'totalDownloads' && - id != 'referrer') { + if (id !== 'totalUploads' && + id !== 'totalDownloads' && + id !== 'referrer') { unexpiredFiles += 1; } }