mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Fix file upload progress.
This commit is contained in:
parent
6eb2f5f1bc
commit
29df1df67b
@ -392,9 +392,13 @@ function uploadFiles(fileList) {
|
||||
AddConsoleOutput("File upload failed.");
|
||||
reject();
|
||||
});
|
||||
xhr.addEventListener("progress", function (e) {
|
||||
AddConsoleOutput("File upload progress: " + String(isFinite(e.loaded / e.total) ? e.loaded / e.total : 0) + "%");
|
||||
});
|
||||
xhr.upload.onprogress = (e) => {
|
||||
var currentPercent = isFinite(e.loaded / e.total) ? Math.round(e.loaded / e.total * 100) : 0;
|
||||
if (currentPercent != uploadPercent) {
|
||||
var uploadPercent = currentPercent;
|
||||
AddConsoleOutput("File upload progress: " + String(currentPercent) + "%");
|
||||
}
|
||||
};
|
||||
xhr.send(fd);
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -537,9 +537,16 @@ function uploadFiles(fileList: FileList): Promise<string[]> {
|
||||
AddConsoleOutput("File upload failed.");
|
||||
reject();
|
||||
});
|
||||
xhr.addEventListener("progress", function (e) {
|
||||
AddConsoleOutput("File upload progress: " + String(isFinite(e.loaded / e.total) ? e.loaded / e.total : 0) + "%");
|
||||
});
|
||||
|
||||
xhr.upload.onprogress = (e) => {
|
||||
var currentPercent = isFinite(e.loaded / e.total) ? Math.round(e.loaded / e.total * 100) : 0;
|
||||
|
||||
if (currentPercent != uploadPercent) {
|
||||
var uploadPercent = currentPercent;
|
||||
AddConsoleOutput("File upload progress: " + String(currentPercent) + "%");
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send(fd);
|
||||
})
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user