From 14f3d837f90b26f831abe873a2826e49a7783ab5 Mon Sep 17 00:00:00 2001 From: Abhinav Adduri Date: Fri, 21 Jul 2017 12:52:28 -0700 Subject: [PATCH] if checkexistence removes the last item in the list, call toggleHeader --- frontend/src/upload.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/upload.js b/frontend/src/upload.js index c75380d2..3bcca1b0 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -80,6 +80,7 @@ $(document).ready(function() { $copyBtn.attr('data-l10n-id', 'copyUrlFormButton'); const files = storage.files; + console.log(files); if (files.length === 0) { toggleHeader(); } else { @@ -90,6 +91,7 @@ $(document).ready(function() { } } + // copy link to clipboard $copyBtn.click(() => { // record copied event from success screen @@ -341,6 +343,9 @@ $(document).ready(function() { } } else if (xhr.status === 404) { storage.remove(id); + if (storage.numFiles === 0) { + toggleHeader(); + } } } };