Stop prefetching when viewerMain template is destroyed (e.g. when you go back to study list)
This commit is contained in:
parent
3c8c52ab1b
commit
f7a4a56155
@ -37,6 +37,8 @@ Template.viewerMain.onRendered(() => {
|
|||||||
const { studies } = instance.data;
|
const { studies } = instance.data;
|
||||||
const parentElement = instance.$('#layoutManagerTarget').get(0);
|
const parentElement = instance.$('#layoutManagerTarget').get(0);
|
||||||
const studyPrefetcher = StudyPrefetcher.getInstance();
|
const studyPrefetcher = StudyPrefetcher.getInstance();
|
||||||
|
instance.studyPrefetcher = studyPrefetcher;
|
||||||
|
|
||||||
const studyLoadingListener = StudyLoadingListener.getInstance();
|
const studyLoadingListener = StudyLoadingListener.getInstance();
|
||||||
|
|
||||||
studyLoadingListener.clear();
|
studyLoadingListener.clear();
|
||||||
@ -52,6 +54,8 @@ Template.viewerMain.onRendered(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Template.viewerMain.onDestroyed(() => {
|
Template.viewerMain.onDestroyed(() => {
|
||||||
|
const instance = Template.instance();
|
||||||
|
|
||||||
OHIF.log.info('viewerMain onDestroyed');
|
OHIF.log.info('viewerMain onDestroyed');
|
||||||
|
|
||||||
// Remove the Window resize listener
|
// Remove the Window resize listener
|
||||||
@ -67,4 +71,7 @@ Template.viewerMain.onDestroyed(() => {
|
|||||||
ProtocolEngine = null;
|
ProtocolEngine = null;
|
||||||
|
|
||||||
Session.set('OHIFViewerMainRendered', false);
|
Session.set('OHIFViewerMainRendered', false);
|
||||||
|
|
||||||
|
// Stop prefetching when we close the viewer
|
||||||
|
instance.studyPrefetcher.destroy();
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user