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>
|
||||
|
||||
<script src="/dist/index.umd.js" crossorigin></script>
|
||||
<script>
|
||||
window.config = {
|
||||
// default: '/'
|
||||
routerBasename: '/',
|
||||
// default: ''
|
||||
relativeWebWorkerScriptsPath: '',
|
||||
servers: {
|
||||
dicomWeb: [
|
||||
{
|
||||
@ -45,10 +44,7 @@
|
||||
],
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="/dist/index.umd.js" crossorigin></script>
|
||||
<script>
|
||||
window.OHIFStandaloneViewer.installViewer(window.config);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@ -72,7 +72,7 @@ extensionManager.registerExtensions([
|
||||
]);
|
||||
|
||||
// Must run after extension commands are registered
|
||||
if (window.config.hotkeys) {
|
||||
if (window.config && window.config.hotkeys) {
|
||||
hotkeysManager.setHotkeys(window.config.hotkeys, true);
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ class OHIFStandaloneViewer extends Component {
|
||||
];
|
||||
|
||||
const showStudyList =
|
||||
window.config.showStudyList !== undefined
|
||||
window.config && window.config.showStudyList !== undefined
|
||||
? window.config.showStudyList
|
||||
: true;
|
||||
if (showStudyList) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user