Files
ohif-viewer/platform/viewer/src/components/StudyLoadingMonitor.js
T

23 lines
519 B
JavaScript
Raw Normal View History

2021-09-09 04:58:24 -03:00
import { useEffect } from 'react';
import OHIF from '@ohif/core';
2019-01-10 13:30:39 +01:00
2021-09-09 04:58:24 -03:00
const { StudyLoadingListener } = OHIF.classes;
2019-01-10 13:30:39 +01:00
2021-09-09 04:58:24 -03:00
const StudyLoadingMonitor = ({ studies }) => {
useEffect(() => {
const studyLoadingListener = StudyLoadingListener.getInstance();
2019-01-10 13:30:39 +01:00
2021-09-09 04:58:24 -03:00
if (studies && studies.length > 0) {
studyLoadingListener.clear();
studyLoadingListener.addStudies(studies);
}
2019-01-10 13:30:39 +01:00
2021-09-09 04:58:24 -03:00
return () => {
studyLoadingListener.clear();
};
}, [studies]);
2019-01-10 13:30:39 +01:00
2021-09-09 04:58:24 -03:00
return null;
};
2019-01-10 13:30:39 +01:00
export default StudyLoadingMonitor;