Skip to content

Commit

Permalink
minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivamJoker committed Aug 20, 2020
1 parent d6af039 commit 474e7ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ browseBtn.addEventListener("click", () => {

dropZone.addEventListener("drop", (e) => {
e.preventDefault();
console.log("dropped", e.dataTransfer.files[0].name);
if (e.dataTransfer.files.length) {
// console.log("dropped", e.dataTransfer.files[0].name);
if (e.dataTransfer.files.length === 1) {
fileInput.files = e.dataTransfer.files;
uploadFile();
} else if (e.dataTransfer.files.length > 1) {
showToast("You can't upload multiple files");
}
dropZone.classList.remove("dragged");
});
Expand Down Expand Up @@ -86,7 +88,7 @@ const uploadFile = () => {

// handle error
xhr.upload.onerror = function () {
alert(`Error during the upload: ${xhr.status}.`);
showToast(`Error in upload: ${xhr.status}.`);
};

// listen for response which will give the link
Expand Down
1 change: 1 addition & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ body,
.sharing-container .expire {
font-size: 16px;
opacity: 0.7;
margin-top: 0;
}

.sharing-container .input-container {
Expand Down

0 comments on commit 474e7ff

Please sign in to comment.