Fix the issues with customized store and retrieve functions for hot keys and window/level presets

This commit is contained in:
Evren Ozkan committed 2017-12-13 19:41:47 -05:00
1 parent 6b8613017e
commit 51d6a64c45
2 files changed
+10 -2

No files matched your search

@@ -50,6 +50,14 @@ class WindowLevelPresetsManager {
this.changeObserver = new Tracker.Dependency();
}
setRetrieveFunction(retrieveFunction) {
this.retrieveFunction = retrieveFunction;
}
setStoreFunction(storeFunction) {
this.storeFunction = storeFunction;
}
updateElementWLPresetData(element) {
const wlPresetData = cornerstone.getElementData(element, 'wlPreset');
const enabledElement = cornerstone.getEnabledElement(element);
@@ -123,7 +131,7 @@ class WindowLevelPresetsManager {
store(wlPresets) {
return new Promise((resolve, reject) => {
if (this.storeFunction) {
this.storeFunction.call(this, wlPresets).then(resolve).catch(reject);
this.storeFunction.call(this, WL_STORAGE_KEY, wlPresets).then(resolve).catch(reject);
} else if (Meteor.userId()) {
OHIF.user.setData(WL_STORAGE_KEY, wlPresets).then(resolve).catch(reject);
} else {