Skip to content

Commit

Permalink
getting signed request only if tags, headings and image files are def…
Browse files Browse the repository at this point in the history
…ined

relates to #163
  • Loading branch information
pbywater committed Aug 3, 2017
1 parent e47c158 commit d82d023
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/scripts/s3-uploads.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ function updateTagAndHeading(imageId) {
localStorage.setItem('imageTagAndHeading', tagAndHeading);
}
};
if (navigator.onLine && localStorage.getItem('imageTagAndHeading').length) {
if (navigator.onLine && localStorage.getItem('imageTagAndHeading')) {
const tagAndHeading = localStorage.getItem('imageTagAndHeading');
addTagAndHeadingToDB(tagAndHeading.tag, tagAndHeading.heading, imageId);
}
}

document.addEventListener('DOMContentLoaded', (event) => {
if (navigator.onLine) {
if (localStorage.getItem('imageTagAndHeading') && navigator.onLine) {
const file = retrieveImage();
if (file) {
console.log('file is ', file);
Expand Down

0 comments on commit d82d023

Please sign in to comment.