From f4167ae7f1df7c2cd4cf264fc4d79d51b8c51133 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sun, 1 Jun 2025 10:44:45 +0900 Subject: enhance(frontend): 非同期的なコンポーネントの読み込み時のハンドリングを強化 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/ui/_common_/common.ts | 6 +++--- packages/frontend/src/ui/_common_/navbar-h.vue | 4 ++-- packages/frontend/src/ui/_common_/navbar.vue | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'packages/frontend/src/ui/_common_') diff --git a/packages/frontend/src/ui/_common_/common.ts b/packages/frontend/src/ui/_common_/common.ts index 819e1fa42f..9872937d21 100644 --- a/packages/frontend/src/ui/_common_/common.ts +++ b/packages/frontend/src/ui/_common_/common.ts @@ -4,10 +4,10 @@ */ import { defineAsyncComponent } from 'vue'; +import { host } from '@@/js/config.js'; import type { MenuItem } from '@/types/menu.js'; import * as os from '@/os.js'; import { instance } from '@/instance.js'; -import { host } from '@@/js/config.js'; import { i18n } from '@/i18n.js'; import { $i } from '@/i.js'; @@ -146,8 +146,8 @@ export function openInstanceMenu(ev: MouseEvent) { menuItems.push({ text: i18n.ts._initialTutorial.launchTutorial, icon: 'ti ti-presentation', - action: () => { - const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkTutorialDialog.vue')), {}, { + action: async () => { + const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkTutorialDialog.vue').then(x => x.default), {}, { closed: () => dispose(), }); }, diff --git a/packages/frontend/src/ui/_common_/navbar-h.vue b/packages/frontend/src/ui/_common_/navbar-h.vue index 24e2b28f1c..688e195ce6 100644 --- a/packages/frontend/src/ui/_common_/navbar-h.vue +++ b/packages/frontend/src/ui/_common_/navbar-h.vue @@ -71,8 +71,8 @@ const otherNavItemIndicated = computed(() => { return false; }); -function more(ev: MouseEvent) { - const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkLaunchPad.vue')), { +async function more(ev: MouseEvent) { + const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkLaunchPad.vue').then(x => x.default), { anchorElement: ev.currentTarget ?? ev.target, anchor: { x: 'center', y: 'bottom' }, }, { diff --git a/packages/frontend/src/ui/_common_/navbar.vue b/packages/frontend/src/ui/_common_/navbar.vue index c8b7491895..28913a54ab 100644 --- a/packages/frontend/src/ui/_common_/navbar.vue +++ b/packages/frontend/src/ui/_common_/navbar.vue @@ -176,10 +176,10 @@ function openAccountMenu(ev: MouseEvent) { }, ev); } -function more(ev: MouseEvent) { +async function more(ev: MouseEvent) { const target = getHTMLElementOrNull(ev.currentTarget ?? ev.target); if (!target) return; - const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkLaunchPad.vue')), { + const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkLaunchPad.vue').then(x => x.default), { anchorElement: target, }, { closed: () => dispose(), -- cgit v1.2.3-freya