Skip to content

Commit

Permalink
MPR Remove unused script
Browse files Browse the repository at this point in the history
Remove unused script
  • Loading branch information
pkong-ds authored Aug 22, 2024
2 parents 13b3482 + 842f9b4 commit 0fec4f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
3 changes: 0 additions & 3 deletions public/scripts/menu.js

This file was deleted.

36 changes: 2 additions & 34 deletions public/scripts/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ class RootViewModel {
fileList;
isFileDragEnter = false;
_isGeneratingMockup = false;
_socket = null;
_redirectTimer = null;
worker = new Worker("/scripts/web_worker.js");
previewWorker = new Worker("/scripts/preview_worker.js");
selectedColorId = null;
Expand Down Expand Up @@ -249,34 +247,15 @@ class RootViewModel {
runWorker(this.worker);
}

_prepareMockup() {
this._scheduleRedirect(0);
}

cancelMockup() {
if (!this.isGeneratingMockup) {
return;
}
this._cancelScheduleRedirect();
this._socket = null;
this._isGeneratingMockup = false;
this.worker.terminate();
this.worker = new Worker("/scripts/web_worker.js");
}

_scheduleRedirect(sec) {
this._redirectTimer = setTimeout(() => {
window.location.replace(this.previewUrl);
}, sec * 1000);
}

_cancelScheduleRedirect() {
if (this._redirectTimer != null) {
clearTimeout(this._redirectTimer);
this._redirectTimer = null;
}
}

get previewUrl() {
return "/download/?deviceId=" + window.workerDeviceId;
}
Expand Down Expand Up @@ -386,8 +365,6 @@ function updateFileListItem(itemNode, imageUpload) {
"file-list-item--error",
"file-list-item--warning",
"file-list-item__previewable",
// NOTE: do not remove progress state immediately so the progress bar can proceed to 100% before being removed
// "file-list-item--progress"
);
previewNode.classList.remove(
"file-list-item__preview_selected",
Expand All @@ -401,7 +378,6 @@ function updateFileListItem(itemNode, imageUpload) {
| warning icon | | | | y | | y |
| done icon | | | | | y | |
| hint text | error hint | error hint | | ratio hint | | ratio hint |
| progress bar | | | y | y | | |
*/

// const deviceData = passResolution();
Expand All @@ -426,10 +402,7 @@ function updateFileListItem(itemNode, imageUpload) {
// Update status icon
// error status has higher precedence over warning
if (imageUpload.isErrorState) {
itemNode.classList.remove(
"file-list-item--progress",
"file-list-item--loading",
);
itemNode.classList.remove("file-list-item--loading");
itemNode.classList.add("file-list-item--error");
} else if (shouldShowAspectRatioWarning) {
itemNode.classList.add("file-list-item--warning");
Expand All @@ -441,16 +414,11 @@ function updateFileListItem(itemNode, imageUpload) {
}

if (imageUpload.isSuccessState) {
itemNode.classList.remove(
"file-list-item--loading",
"file-list-item--progress",
);
itemNode.classList.remove("file-list-item--loading");
itemNode.classList.add(
"file-list-item--done",
"file-list-item__previewable",
);
} else if (imageUpload.isProcessingState) {
itemNode.classList.add("file-list-item--progress");
}
// update hint text
if (imageUpload.isErrorState) {
Expand Down

0 comments on commit 0fec4f8

Please sign in to comment.