mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-14 12:15:44 +02:00
enhance(frontend): 非同期的なコンポーネントの読み込み時のハンドリングを強化
This commit is contained in:
@@ -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(),
|
||||
});
|
||||
},
|
||||
|
||||
@@ -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' },
|
||||
}, {
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -72,7 +72,7 @@ async function setAntenna() {
|
||||
if (canceled || antenna == null) return;
|
||||
|
||||
if (antenna === '_CREATE_') {
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkAntennaEditorDialog.vue')), {}, {
|
||||
const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkAntennaEditorDialog.vue').then(x => x.default), {}, {
|
||||
created: (newAntenna: MisskeyEntities.Antenna) => {
|
||||
antennasCache.delete();
|
||||
updateColumn(props.column.id, {
|
||||
|
||||
@@ -27,8 +27,8 @@ const props = defineProps<{
|
||||
|
||||
const notificationsComponent = useTemplateRef('notificationsComponent');
|
||||
|
||||
function func() {
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkNotificationSelectWindow.vue')), {
|
||||
async function func() {
|
||||
const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkNotificationSelectWindow.vue').then(x => x.default), {
|
||||
excludeTypes: props.column.excludeTypes,
|
||||
}, {
|
||||
done: async (res) => {
|
||||
|
||||
Reference in New Issue
Block a user