Viewer renderer stop loading when subsequent renderer throws error (#10931)

* Viewer renderer stop loading when subsequent renderer throws error

* Update lib/core/src/lib/viewer/components/viewer-render/viewer-render.component.spec.ts

* CR fix

---------

Co-authored-by: Michaela <85624192+mkrbr@users.noreply.github.com>
This commit is contained in:
MichalKinas
2025-06-12 11:47:22 +02:00
committed by GitHub
parent 31c2cb2162
commit f8a75d4af7
2 changed files with 12 additions and 0 deletions

View File

@@ -537,5 +537,16 @@ describe('ViewerComponent', () => {
expect(component.viewerType).toBe('image');
expect(component.markAsLoaded).toHaveBeenCalled();
});
it('should not show spinner and set viewerType to unknown if subsequent renderer throws an error', () => {
component.urlFile = 'some-url.png';
fixture.detectChanges();
expect(getMainLoader()).not.toBeNull();
component.onUnsupportedFile();
fixture.detectChanges();
expect(getMainLoader()).toBeNull();
expect(component.viewerType).toBe('unknown');
});
});
});

View File

@@ -235,6 +235,7 @@ export class ViewerRenderComponent implements OnChanges, OnInit {
onUnsupportedFile() {
this.viewerType = 'unknown';
this.isLoading = false;
}
onClose() {