feat(errorHandling): Create fallback page for Server, Study and Series (#3592)
This commit is contained in:
1 parent
9c51f17c60
commit
19408c987f
6 files changed
+100
-1
No files matched your search
@@ -5,6 +5,7 @@ import { ExtensionManager, MODULE_TYPES } from '@ohif/core';
|
||||
//
|
||||
import { extensionManager } from '../App.tsx';
|
||||
import { useParams, useLocation } from 'react-router';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import useSearchParams from '../hooks/useSearchParams.ts';
|
||||
|
||||
/**
|
||||
@@ -27,6 +28,7 @@ const areLocationsTheSame = (location0, location1) => {
|
||||
* @param {function} props.children - Layout Template React Component
|
||||
*/
|
||||
function DataSourceWrapper(props) {
|
||||
const navigate = useNavigate();
|
||||
const { children: LayoutTemplate, ...rest } = props;
|
||||
const params = useParams();
|
||||
const location = useLocation();
|
||||
@@ -189,7 +191,7 @@ function DataSourceWrapper(props) {
|
||||
(!isLoading && (newOffset !== previousOffset || isLocationUpdated));
|
||||
|
||||
if (isDataInvalid) {
|
||||
getData();
|
||||
getData().catch(() => navigate('/notfoundserver', '_self'));
|
||||
}
|
||||
} catch (ex) {
|
||||
console.warn(ex);
|
||||
|
||||
Reference in new issue
Block a user