From 42ef0facc98f323bc3539c72948eeec6bddc8567 Mon Sep 17 00:00:00 2001 From: Peter deHaan Date: Sat, 29 Jul 2017 00:04:50 -0700 Subject: [PATCH 1/3] Get rid of console.log statements --- frontend/src/download.js | 1 - frontend/src/fileSender.js | 9 ++------- frontend/src/upload.js | 3 --- server/server.js | 1 + 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/frontend/src/download.js b/frontend/src/download.js index 224d3731..e9bf9097 100644 --- a/frontend/src/download.js +++ b/frontend/src/download.js @@ -90,7 +90,6 @@ $(document).ready(function() { $('.progress-text').text(decryptingFile); }); } else { - console.log('Done decrypting'); downloadEnd = Date.now(); } }); diff --git a/frontend/src/fileSender.js b/frontend/src/fileSender.js index 97c76deb..e67010d2 100644 --- a/frontend/src/fileSender.js +++ b/frontend/src/fileSender.js @@ -24,12 +24,6 @@ class FileSender extends EventEmitter { if (xhr.readyState === XMLHttpRequest.DONE) { resolve(); } - - if (xhr.status === 200) { - console.log('The file was successfully deleted.'); - } else { - console.log('The file has expired, or has already been deleted.'); - } }; xhr.send(JSON.stringify({ delete_token: token })); @@ -54,7 +48,8 @@ class FileSender extends EventEmitter { ['encrypt', 'decrypt'] ) .catch(err => - console.log('There was an error generating a crypto key') + // eslint-disable-next-line no-console + console.error('There was an error generating a crypto key') ), new Promise((resolve, reject) => { const reader = new FileReader(); diff --git a/frontend/src/upload.js b/frontend/src/upload.js index 967eeb52..f3ab980f 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -206,8 +206,6 @@ $(document).ready(function() { document.l10n.formatValue('verifyingFile').then(verifyingFile => { $('.progress-text').text(verifyingFile); }); - } else { - console.log('Finished hashing'); } }); @@ -219,7 +217,6 @@ $(document).ready(function() { $('.progress-text').text(encryptingFile); }); } else { - console.log('Finished encrypting'); uploadStart = Date.now(); } }); diff --git a/server/server.js b/server/server.js index 92fcee82..dddbd5f6 100644 --- a/server/server.js +++ b/server/server.js @@ -33,6 +33,7 @@ function allLangs() { } function prodLangs() { + // eslint-disable-next-line security/detect-non-literal-require return require(path.join( __dirname, '..', From 8d1baca60e434651859bf18b04cec5a181714084 Mon Sep 17 00:00:00 2001 From: Peter deHaan Date: Sat, 29 Jul 2017 15:25:50 -0700 Subject: [PATCH 2/3] Remove catch() block --- frontend/src/fileSender.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frontend/src/fileSender.js b/frontend/src/fileSender.js index e67010d2..6aad32e7 100644 --- a/frontend/src/fileSender.js +++ b/frontend/src/fileSender.js @@ -46,10 +46,6 @@ class FileSender extends EventEmitter { }, true, ['encrypt', 'decrypt'] - ) - .catch(err => - // eslint-disable-next-line no-console - console.error('There was an error generating a crypto key') ), new Promise((resolve, reject) => { const reader = new FileReader(); From dff443287c06b95dd5148d9aed75a59666dd3fe3 Mon Sep 17 00:00:00 2001 From: Peter deHaan Date: Sun, 30 Jul 2017 20:11:12 -0700 Subject: [PATCH 3/3] Tweak the package.json require statement --- server/server.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/server/server.js b/server/server.js index dddbd5f6..780c18b6 100644 --- a/server/server.js +++ b/server/server.js @@ -33,12 +33,7 @@ function allLangs() { } function prodLangs() { - // eslint-disable-next-line security/detect-non-literal-require - return require(path.join( - __dirname, - '..', - 'package.json' - )).availableLanguages.join(','); + return require('../package.json').availableLanguages.join(','); } const availableLanguages = conf.l10n_dev ? allLangs() : prodLangs();