mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-23 04:10:39 +01:00
Update boot.ts
This commit is contained in:
parent
e6c7b914d7
commit
9a0ac64f12
1 changed files with 24 additions and 0 deletions
|
@ -37,6 +37,30 @@ const app = createApp(
|
|||
app.provide('embedParams', embedParams);
|
||||
//#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();
|
||||
|
||||
function removeSplash() {
|
||||
|
|
Loading…
Reference in a new issue