fix(upload): add ChangeDetectorRef calls to ensure UI updates during file upload process (#557)

This commit is contained in:
brios
2026-04-22 17:27:38 -04:00
committed by Zach Yale
parent 13f282fe72
commit bf4fab3785
2 changed files with 13 additions and 3 deletions
@@ -168,6 +168,7 @@ export class AdditionalFileUploaderComponent implements OnInit, OnDestroy {
).subscribe({
next: () => {
uploadFile.status = 'Uploaded';
this.cdr.detectChanges();
if (--pending === 0) {
this.isUploading = false;
this.dialogRef.close({ success: true });
@@ -177,8 +178,10 @@ export class AdditionalFileUploaderComponent implements OnInit, OnDestroy {
uploadFile.status = 'Failed';
uploadFile.errorMessage = err?.error?.message || this.t.translate('book.fileUploader.toast.uploadFailedUnknown');
console.error('Upload failed for', uploadFile.file.name, err);
this.cdr.detectChanges();
if (--pending === 0) {
this.isUploading = false;
this.cdr.detectChanges();
}
}
});