never make two app div

This commit is contained in:
tamaina 2022-04-29 01:00:47 +09:00
parent e0740f93d0
commit dd5e493ab5
2 changed files with 19 additions and 10 deletions

View file

@ -13,6 +13,7 @@
// ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので
(async () => {
console.log('boot!')
window.onerror = (e) => {
renderError('SOMETHING_HAPPENED', e.toString());
};
@ -58,14 +59,11 @@
? `?salt=${localStorage.getItem('salt')}`
: '';
const script = document.createElement('script');
script.setAttribute('src', `/assets/${CLIENT_ENTRY}${salt}`);
script.setAttribute('type', 'module');
script.addEventListener('error', async () => {
await checkUpdate();
renderError('APP_FETCH_FAILED');
});
document.head.appendChild(script);
import(`/assets/${CLIENT_ENTRY}${salt}`)
.catch(async () => {
await checkUpdate();
renderError('APP_FETCH_FAILED');
})
//#endregion
//#region Theme