From eda901ba4addc94b37d029dd6fea3db8ed77b01f Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Fri, 23 Jun 2017 17:05:41 -0700 Subject: [PATCH] fixed lint --- frontend/src/fileSender.js | 4 ---- frontend/src/upload.js | 14 +++++++------- package-lock.json | 6 +++--- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/frontend/src/fileSender.js b/frontend/src/fileSender.js index ede0b252..c443443a 100644 --- a/frontend/src/fileSender.js +++ b/frontend/src/fileSender.js @@ -66,10 +66,6 @@ class FileSender extends EventEmitter { window.crypto.subtle.exportKey('jwk', secretKey) ]); }) - .catch(err => { - Raven.captureException(err); - return Promise.reject(err); - }) .then(([encrypted, keydata]) => { return new Promise((resolve, reject) => { const file = this.file; diff --git a/frontend/src/upload.js b/frontend/src/upload.js index 1e5bb5f5..4988e001 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -2,8 +2,6 @@ const FileSender = require('./fileSender'); const { notify } = require('./utils'); const $ = require('jquery'); -const Raven = window.Raven; - $(document).ready(function() { // reset copy button const $copyBtn = $('#copy-btn'); @@ -16,13 +14,13 @@ $(document).ready(function() { $('#share-link').hide(); for (let i = 0; i < localStorage.length; i++) { - let id = localStorage.key(i); + const id = localStorage.key(i); populateFileList(localStorage.getItem(id)); } // copy link to clipboard $copyBtn.click(() => { - var aux = document.createElement('input'); + const aux = document.createElement('input'); aux.setAttribute('value', $('#link').attr('value')); document.body.appendChild(aux); aux.select(); @@ -87,6 +85,7 @@ $(document).ready(function() { $('#share-link').show(); populateFileList(JSON.stringify(fileData)); + notify('Your upload has finished.'); }); }; @@ -96,9 +95,11 @@ $(document).ready(function() { //update file table with current files in localStorage function populateFileList(file) { - file = JSON.parse(file); + try { + file = JSON.parse(file); + } + catch (e) { return } - const $fileList = $('#uploaded-files'); const row = document.createElement('tr'); const name = document.createElement('td'); const link = document.createElement('td'); @@ -109,7 +110,6 @@ $(document).ready(function() { const popupDiv = document.createElement('div'); const $popupText = $('', { class: 'popuptext' }); const cellText = document.createTextNode(file.name); - const progress = document.createElement('p'); name.appendChild(cellText); diff --git a/package-lock.json b/package-lock.json index 3ab4be91..e456c480 100644 --- a/package-lock.json +++ b/package-lock.json @@ -198,9 +198,9 @@ "dev": true }, "aws-sdk": { - "version": "2.76.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.76.0.tgz", - "integrity": "sha1-LDe/BON6tKJrX/fHWD1ZYDTHYwk=" + "version": "2.77.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.77.0.tgz", + "integrity": "sha1-gJCQu4dNj0//ysUxZilYdjjnhlw=" }, "babel-code-frame": { "version": "6.22.0",