Display error if JS fails to load. Fixes #404
This commit is contained in:
parent
a359652e93
commit
af2ab839ac
10
index.html
10
index.html
@ -386,5 +386,15 @@
|
|||||||
|
|
||||||
<main id="app" aria-hidden="true"></main>
|
<main id="app" aria-hidden="true"></main>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.addEventListener('load', () => {
|
||||||
|
if(!window.liveAtlasLoaded) {
|
||||||
|
document.getElementById('splash__error').setAttribute('aria-hidden', 'false');
|
||||||
|
document.getElementById('splash__error-message').innerText = 'Required LiveAtlas files are missing or failed to load.\nPlease reinstall LiveAtlas.';
|
||||||
|
document.getElementById('splash__spinner').style.visibility = 'hidden';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
1
src/index.d.ts
vendored
1
src/index.d.ts
vendored
@ -47,6 +47,7 @@ declare global {
|
|||||||
// noinspection JSUnusedGlobalSymbols
|
// noinspection JSUnusedGlobalSymbols
|
||||||
interface Window {
|
interface Window {
|
||||||
liveAtlasConfig: LiveAtlasGlobalConfig,
|
liveAtlasConfig: LiveAtlasGlobalConfig,
|
||||||
|
liveAtlasLoaded: ?boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
declare const process : {
|
declare const process : {
|
||||||
|
@ -59,6 +59,7 @@ registerMapProvider('squaremap', Pl3xmapMapProvider);
|
|||||||
registerMapProvider('overviewer', OverviewerMapProvider);
|
registerMapProvider('overviewer', OverviewerMapProvider);
|
||||||
|
|
||||||
const config = window.liveAtlasConfig;
|
const config = window.liveAtlasConfig;
|
||||||
|
window.liveAtlasLoaded = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
config.servers = loadConfig(config);
|
config.servers = loadConfig(config);
|
||||||
|
Loading…
Reference in New Issue
Block a user