diff --git a/frontend/src/upload.js b/frontend/src/upload.js
index 7b87fdc3..79ca4dd4 100644
--- a/frontend/src/upload.js
+++ b/frontend/src/upload.js
@@ -94,9 +94,6 @@ $(() => {
$uploadWindow.removeClass('ondrag');
});
- //link back to homepage
- $('.send-new').attr('href', window.location);
-
// on file upload by browse or drag & drop
function onUpload(event) {
event.preventDefault();
@@ -219,6 +216,30 @@ $(() => {
uploadSpeed: speed
};
+ $('#delete-file').on('click', () => {
+ FileSender.delete(
+ fileData.fileId,
+ fileData.deleteToken
+ ).then(() => {
+ const ttl =
+ ONE_DAY_IN_MS -
+ (Date.now() - fileData.creationDate.getTime());
+ metrics
+ .deletedUpload({
+ size: fileData.size,
+ time: fileData.totalTime,
+ speed: fileData.uploadSpeed,
+ type: fileData.typeOfUpload,
+ location: 'success-screen',
+ ttl
+ })
+ .then(() => {
+ storage.remove(fileData.fileId);
+ location.reload();
+ });
+ });
+ });
+
storage.addFile(info.fileId, fileData);
$pageOne.attr('hidden', true);
@@ -428,26 +449,6 @@ $(() => {
});
});
- $('#delete-file').on('click', () => {
- FileSender.delete(file.fileId, file.deleteToken).then(() => {
- const ttl =
- ONE_DAY_IN_MS - (Date.now() - file.creationDate.getTime());
- metrics
- .deletedUpload({
- size: file.size,
- time: file.totalTime,
- speed: file.uploadSpeed,
- type: file.typeOfUpload,
- location: 'success-screen',
- ttl
- })
- .then(() => {
- storage.remove(file.fileId);
- location.reload();
- });
- });
- });
-
// show popup
$delIcon.on('click', () => {
$popupText.addClass('show').focus();
diff --git a/views/index.handlebars b/views/index.handlebars
index 33c1e1f7..0070b5dc 100644
--- a/views/index.handlebars
+++ b/views/index.handlebars
@@ -61,7 +61,7 @@
-
+