1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 07:35:35 +02:00

enhance(frontend): 非同期的なコンポーネントの読み込み時のハンドリングを強化

This commit is contained in:
syuilo
2025-06-01 10:44:45 +09:00
parent 63db879bcc
commit f4167ae7f1
33 changed files with 120 additions and 72 deletions

View File

@@ -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(),
});
},

View File

@@ -71,8 +71,8 @@ const otherNavItemIndicated = computed<boolean>(() => {
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' },
}, {

View File

@@ -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(),