mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-02 17:55:52 +02:00
enhance(frontend): 非同期的なコンポーネントの読み込み時のハンドリングを強化
This commit is contained in:
@@ -282,8 +282,8 @@ function onContextmenu(ev: MouseEvent) {
|
||||
menu = [{
|
||||
text: i18n.ts.openInWindow,
|
||||
icon: 'ti ti-app-window',
|
||||
action: () => {
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkDriveWindow.vue')), {
|
||||
action: async () => {
|
||||
const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkDriveWindow.vue').then(x => x.default), {
|
||||
initialFolder: props.folder,
|
||||
}, {
|
||||
closed: () => dispose(),
|
||||
|
||||
@@ -126,7 +126,7 @@ async function rename(file) {
|
||||
async function describe(file: Misskey.entities.DriveFile) {
|
||||
if (mock) return;
|
||||
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), {
|
||||
const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkFileCaptionEditWindow.vue').then(x => x.default), {
|
||||
default: file.comment !== null ? file.comment : '',
|
||||
file: file,
|
||||
}, {
|
||||
@@ -168,9 +168,11 @@ function showFileMenu(file: Misskey.entities.DriveFile, ev: MouseEvent | Keyboar
|
||||
menuItems.push({
|
||||
text: i18n.ts.preview,
|
||||
icon: 'ti ti-photo-search',
|
||||
action: () => {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkImgPreviewDialog.vue')), {
|
||||
action: async () => {
|
||||
const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkImgPreviewDialog.vue').then(x => x.default), {
|
||||
file: file,
|
||||
}, {
|
||||
closed: () => dispose(),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -174,8 +174,8 @@ function setupComplete() {
|
||||
|
||||
function launchTutorial() {
|
||||
setupComplete();
|
||||
nextTick(() => {
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkTutorialDialog.vue')), {
|
||||
nextTick(async () => {
|
||||
const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkTutorialDialog.vue').then(x => x.default), {
|
||||
initialPage: 1,
|
||||
}, {
|
||||
closed: () => dispose(),
|
||||
|
||||
@@ -185,7 +185,7 @@ async function edit(name: string) {
|
||||
const emoji = await misskeyApi('emoji', {
|
||||
name: name,
|
||||
});
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/pages/emoji-edit-dialog.vue')), {
|
||||
const { dispose } = await os.popupAsyncWithDialog(import('@/pages/emoji-edit-dialog.vue').then(x => x.default), {
|
||||
emoji: emoji,
|
||||
}, {
|
||||
closed: () => dispose(),
|
||||
|
||||
Reference in New Issue
Block a user