fix(grid):Grid service wasn't being reset (#3068)

* fix(grid):Grid service wasn't being reset

* fix(service):Fix the initial service state

Services with mode specific state differed in internal state between
initial and subsequent load.  This fix address that structurally by
allows the mode to store/manage service state, but makes the
responsibility of service state central to the service.
This commit is contained in:
Bill Wallace authored and GitHub committed 2022-12-09 10:58:01 -05:00
1 parent 42dca11ae3
commit beb4517450
17 files changed
+120 -28

No files matched your search

@@ -452,6 +452,7 @@ function _getViewportComponent(
}
}
console.log("Can't show displaySet", SOPClassHandlerId, displaySets[0]);
UINotificationService.show({
title: 'Viewport Not Supported Yet',
message: `Cannot display SOPClassId of ${displaySets[0].SOPClassUID} yet`,
+13 -2
View File
@@ -312,11 +312,22 @@ export default function ModeRoute({
});
return () => {
extensionManager.onModeExit();
mode?.onModeExit({ servicesManager, extensionManager });
// The mode.onModeExit must be done first to allow it to store
// information, and must be in a try/catch to ensure subscriptions
// are unsubscribed.
try {
mode?.onModeExit?.({ servicesManager, extensionManager });
} catch (e) {
console.warn('mode exit failure', e);
}
// The unsubscriptions must occur before the extension onModeExit
// in order to prevent exceptions during cleanup caused by spurious events
unsubscriptions.forEach(unsub => {
unsub();
});
// The extension manager must be called after the mode, this is
// expected to cleanup the state to a standard setup.
extensionManager.onModeExit();
};
}, [
mode,