fix(config): Stop crashes if window.config is not defined when script-tag viewer is loaded
This commit is contained in:
parent
c5f532159b
commit
02c732aa15
@ -25,12 +25,11 @@
|
|||||||
|
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
||||||
|
<script src="/dist/index.umd.js" crossorigin></script>
|
||||||
<script>
|
<script>
|
||||||
window.config = {
|
window.config = {
|
||||||
// default: '/'
|
// default: '/'
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
// default: ''
|
|
||||||
relativeWebWorkerScriptsPath: '',
|
|
||||||
servers: {
|
servers: {
|
||||||
dicomWeb: [
|
dicomWeb: [
|
||||||
{
|
{
|
||||||
@ -45,10 +44,7 @@
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
<script src="/dist/index.umd.js" crossorigin></script>
|
|
||||||
<script>
|
|
||||||
window.OHIFStandaloneViewer.installViewer(window.config);
|
window.OHIFStandaloneViewer.installViewer(window.config);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@ -72,7 +72,7 @@ extensionManager.registerExtensions([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// Must run after extension commands are registered
|
// Must run after extension commands are registered
|
||||||
if (window.config.hotkeys) {
|
if (window.config && window.config.hotkeys) {
|
||||||
hotkeysManager.setHotkeys(window.config.hotkeys, true);
|
hotkeysManager.setHotkeys(window.config.hotkeys, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -136,7 +136,7 @@ class OHIFStandaloneViewer extends Component {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const showStudyList =
|
const showStudyList =
|
||||||
window.config.showStudyList !== undefined
|
window.config && window.config.showStudyList !== undefined
|
||||||
? window.config.showStudyList
|
? window.config.showStudyList
|
||||||
: true;
|
: true;
|
||||||
if (showStudyList) {
|
if (showStudyList) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user