fix(ui): show ui notification on displaySet load error (#4447)
This commit is contained in:
parent
0166956dd8
commit
4f20523109
@ -174,6 +174,7 @@ class CornerstoneCacheService {
|
||||
initialImageIndex,
|
||||
viewportType: Enums.ViewportType
|
||||
): Promise<StackViewportData> {
|
||||
const { uiNotificationService } = this.servicesManager.services;
|
||||
const overlayDisplaySets = displaySets.filter(ds => ds.isOverlayDisplaySet);
|
||||
const nonOverlayDisplaySets = displaySets.filter(ds => !ds.isOverlayDisplaySet);
|
||||
|
||||
@ -182,7 +183,16 @@ class CornerstoneCacheService {
|
||||
if (overlayDisplaySet.load && overlayDisplaySet.load instanceof Function) {
|
||||
const { userAuthenticationService } = this.servicesManager.services;
|
||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||
await overlayDisplaySet.load({ headers });
|
||||
try {
|
||||
await overlayDisplaySet.load({ headers });
|
||||
} catch (e) {
|
||||
uiNotificationService.show({
|
||||
title: 'Error loading overlayDisplaySet',
|
||||
message: e.message,
|
||||
type: 'error',
|
||||
});
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,7 +201,17 @@ class CornerstoneCacheService {
|
||||
if (displaySet.load && displaySet.load instanceof Function) {
|
||||
const { userAuthenticationService } = this.servicesManager.services;
|
||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||
await displaySet.load({ headers });
|
||||
|
||||
try {
|
||||
await displaySet.load({ headers });
|
||||
} catch (e) {
|
||||
uiNotificationService.show({
|
||||
title: 'Error loading displaySet',
|
||||
message: e.message,
|
||||
type: 'error',
|
||||
});
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
let stackImageIds = this.stackImageIds.get(displaySet.displaySetInstanceUID);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user