Added unique ID generator
- Updated data cleaning feature - Added fileID database logic
This commit is contained in:
@ -34,6 +34,7 @@ export class DownloadComponent {
|
||||
fileDownloadFinished: boolean = false;
|
||||
waitingForPassword: boolean = false;
|
||||
downloadProgress: number = 0;
|
||||
targetUploadProgress: number = 0;
|
||||
downloadDuration: string = "";
|
||||
passwordWrong: boolean = false;
|
||||
|
||||
@ -155,8 +156,8 @@ export class DownloadComponent {
|
||||
// Calculate the percentage of download completed
|
||||
if(progressEvent.total) {
|
||||
const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
|
||||
this.downloadProgress = percentCompleted;
|
||||
console.log(percentCompleted + '%'); // Log the percentage or update any progress UI component
|
||||
this.targetUploadProgress = percentCompleted;
|
||||
this.smoothProgressUpdate();
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -201,6 +202,16 @@ export class DownloadComponent {
|
||||
private wrongPassword() {
|
||||
this.passwordWrong = true;
|
||||
}
|
||||
|
||||
smoothProgressUpdate() {
|
||||
if (this.downloadProgress < this.targetUploadProgress) {
|
||||
this.downloadProgress += 0.01 * (this.targetUploadProgress - this.downloadProgress);
|
||||
requestAnimationFrame(this.smoothProgressUpdate.bind(this));
|
||||
} else if (this.downloadProgress > this.targetUploadProgress) {
|
||||
// Handle overshoot
|
||||
this.downloadProgress = this.targetUploadProgress;
|
||||
}
|
||||
}
|
||||
}
|
||||
interface DownloadInfo {
|
||||
downloadable: boolean;
|
||||
|
Reference in New Issue
Block a user