embed uiが正常に読み込まれない問題を修正

This commit is contained in:
kakkokari-gtyih 2024-06-25 23:51:32 +09:00
parent 9c115c87c7
commit b507b6240c
2 changed files with 7 additions and 4 deletions

View file

@ -8,8 +8,9 @@ import 'vite/modulepreload-polyfill';
import '@/style.scss';
import '@/style.embed.scss';
import { createApp, defineAsyncComponent } from 'vue';
import { common } from '@/boot/common.js';
import type { CommonBootOptions } from '@/boot/common.js';
import { subBoot } from '@/boot/sub-boot.js';
import { setIframeId, postMessageToParentWindow } from '@/scripts/post-message.js';
import { defaultStore } from '@/store.js';
@ -35,7 +36,9 @@ window.addEventListener('message', event => {
});
// 起動
subBoot(bootOptions, true).then(() => {
common(() => createApp(
defineAsyncComponent(() => import('@/ui/embed.vue')),
), bootOptions).then(({ isClientUpdated }) => {
// 起動完了を通知(このあとクライアント側から misskey:embedParent:registerIframeId が送信される)
postMessageToParentWindow('misskey:embed:ready');
});

View file

@ -7,8 +7,8 @@ import { createApp, defineAsyncComponent } from 'vue';
import { common } from './common.js';
import type { CommonBootOptions } from './common.js';
export async function subBoot(options?: Partial<CommonBootOptions>, isEmbedPage?: boolean) {
export async function subBoot(options?: Partial<CommonBootOptions>) {
const { isClientUpdated } = await common(() => createApp(
defineAsyncComponent(() => isEmbedPage ? import('@/ui/embed.vue') : import('@/ui/minimum.vue')),
defineAsyncComponent(() => import('@/ui/minimum.vue')),
), options);
}