Update boot.ts

This commit is contained in:
syuilo 2024-08-27 08:20:46 +09:00
parent e6c7b914d7
commit 9a0ac64f12
1 changed files with 24 additions and 0 deletions

View File

@ -37,6 +37,30 @@ const app = createApp(
app.provide('embedParams', embedParams); app.provide('embedParams', embedParams);
//#endregion //#endregion
// https://github.com/misskey-dev/misskey/pull/8575#issuecomment-1114239210
// なぜか2回実行されることがあるため、mountするdivを1つに制限する
const rootEl = ((): HTMLElement => {
const MISSKEY_MOUNT_DIV_ID = 'misskey_app';
const currentRoot = document.getElementById(MISSKEY_MOUNT_DIV_ID);
if (currentRoot) {
console.warn('multiple import detected');
return currentRoot;
}
const root = document.createElement('div');
root.id = MISSKEY_MOUNT_DIV_ID;
document.body.appendChild(root);
return root;
})();
app.mount(rootEl);
// boot.jsのやつを解除
window.onerror = null;
window.onunhandledrejection = null;
removeSplash(); removeSplash();
function removeSplash() { function removeSplash() {