error handling for no internet
This commit is contained in:
@@ -9,16 +9,6 @@
|
||||
/>
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="msapplication-tap-highlight" content="no" />
|
||||
|
||||
<script
|
||||
type="module"
|
||||
src="https://unpkg.com/@ionic/pwa-elements@latest/dist/ionicpwaelements/ionicpwaelements.esm.js"
|
||||
></script>
|
||||
<script
|
||||
nomodule
|
||||
src="https://unpkg.com/@ionic/pwa-elements@latest/dist/ionicpwaelements/ionicpwaelements.js"
|
||||
></script>
|
||||
|
||||
<link rel="manifest" href="./manifest.json" />
|
||||
<link rel="stylesheet" href="./_/code/shared.css" />
|
||||
<script type="module">
|
||||
@@ -36,8 +26,16 @@
|
||||
})
|
||||
}
|
||||
|
||||
await appendScript(window.util.HOST + '/_/code/quill.js')
|
||||
await appendScript(window.util.HOST + '/83947261/index.js', true)
|
||||
try {
|
||||
await appendScript(window.util.HOST + '/_/code/quill.js')
|
||||
await appendScript(window.util.HOST + '/83947261/index.js', true)
|
||||
} catch (e) {
|
||||
document.body.innerHTML = `
|
||||
<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;left:0; top: 0; position: fixed; height:100vh;font-family:sans-serif;text-align:center;padding:2rem">
|
||||
<p style="color: var(--text)">Could not reach the server. Are you connected to the internet?</p>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
</script>
|
||||
<meta name="theme-color" content="#31d53d" />
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user