if checkexistence removes the last item in the list, call toggleHeader

This commit is contained in:
Abhinav Adduri 2017-07-21 12:52:28 -07:00
parent d660eda64c
commit 14f3d837f9
1 changed files with 5 additions and 0 deletions

View File

@ -80,6 +80,7 @@ $(document).ready(function() {
$copyBtn.attr('data-l10n-id', 'copyUrlFormButton'); $copyBtn.attr('data-l10n-id', 'copyUrlFormButton');
const files = storage.files; const files = storage.files;
console.log(files);
if (files.length === 0) { if (files.length === 0) {
toggleHeader(); toggleHeader();
} else { } else {
@ -90,6 +91,7 @@ $(document).ready(function() {
} }
} }
// copy link to clipboard // copy link to clipboard
$copyBtn.click(() => { $copyBtn.click(() => {
// record copied event from success screen // record copied event from success screen
@ -341,6 +343,9 @@ $(document).ready(function() {
} }
} else if (xhr.status === 404) { } else if (xhr.status === 404) {
storage.remove(id); storage.remove(id);
if (storage.numFiles === 0) {
toggleHeader();
}
} }
} }
}; };