diff --git a/res/static/res/script/compiled/home.js b/res/static/res/script/compiled/home.js index 7cf8f52..8c02aa5 100644 --- a/res/static/res/script/compiled/home.js +++ b/res/static/res/script/compiled/home.js @@ -110,13 +110,13 @@ var UploadManager = /** @class */ (function () { this.uploadQueue.push(file); if (this.uploadThreads.length < this.maxThreads) { console.debug("Starting upload thread"); - var thread = new UploadWorker(this); - this.uploadThreads.push(thread); - setTimeout(thread.start(), 0); // Start a new upload thread + var thread_1 = new UploadWorker(this); + this.uploadThreads.push(thread_1); + setTimeout(function () { thread_1.start(); }, 0); // Start a new upload thread } else { for (var i = 0; i < this.uploadThreads.length; i++) { - setTimeout(this.uploadThreads[i].start(), 0); + setTimeout(function () { this.uploadThreads[i].start(); }, 0); } } }; @@ -186,12 +186,12 @@ var UploadWorker = /** @class */ (function () { if (that.tries === 3) { alert("Upload failed: " + status); file.onFailure(status, error); - setTimeout(that.newFile(), 2000); // Try to continue + setTimeout(function () { that.newFile(); }, 2000); // Try to continue return; // Upload failed } // Try again that.tries++; - setTimeout(that.upload(file), that.tries * 3000); + setTimeout(function () { that.upload(file); }, that.tries * 3000); } }); }; diff --git a/res/static/res/typescript/lib/uploader.ts b/res/static/res/typescript/lib/uploader.ts index fdb9ba4..b0174f2 100644 --- a/res/static/res/typescript/lib/uploader.ts +++ b/res/static/res/typescript/lib/uploader.ts @@ -18,10 +18,10 @@ class UploadManager { console.debug("Starting upload thread") let thread = new UploadWorker(this) this.uploadThreads.push(thread) - setTimeout(thread.start(), 0) // Start a new upload thread + setTimeout(function(){thread.start()}, 0) // Start a new upload thread } else { for (var i = 0; i < this.uploadThreads.length; i++) { - setTimeout(this.uploadThreads[i].start(), 0) + setTimeout(function(){this.uploadThreads[i].start()}, 0) } } } @@ -101,13 +101,13 @@ class UploadWorker { alert("Upload failed: " + status); file.onFailure(status, error) - setTimeout(that.newFile(), 2000) // Try to continue + setTimeout(function(){that.newFile()}, 2000) // Try to continue return; // Upload failed } // Try again that.tries++ - setTimeout(that.upload(file), that.tries*3000) + setTimeout(function(){that.upload(file)}, that.tries*3000) } }); }