fix file upload progress bar

master
Niko PLP 3 months ago
parent 44fd445f4d
commit dc4cf5ae13
  1. 2
      ng-app/src/apps/automerge/ADate.svelte
  2. 10
      ng-app/src/lib/panes/Files.svelte

@ -36,7 +36,7 @@
const change = (event) => {
let newval = new Date(date.split('/').reverse().join('/')+" "+time);
console.log(time, date, newval)
//console.log(time, date, newval)
dispatch('updateScalar', {
v: newval,

@ -65,7 +65,7 @@
}
function uploadFile(upload_id, nuri, file, success) {
console.log(nuri);
//console.log(nuri);
let chunkSize = 1_048_564;
let fileSize = file.size;
let offset = 0;
@ -95,6 +95,7 @@
// if (onChunkError) {
// onChunkError(event.target.error);
// }
upload_progress = { total: fileSize, current: fileSize, error: true };
return;
}
@ -110,15 +111,12 @@
//console.log("end upload res", res);
if (success) {
upload_progress = { total: fileSize, current: fileSize };
success(res);
} else {
upload_progress = { total: fileSize, current: fileSize, error: true };
}
await success(res);
// Make progress bar disappear
setTimeout(() => {
upload_progress = null;
}, 1_000);
}
return;
}

Loading…
Cancel
Save