From 3118825fa92e08a0dee7c9117b9d23de6a5e81b3 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 18 Feb 2023 16:28:50 -0800 Subject: [PATCH] will fix? --- packages/client/src/components/MkUpdated.vue | 2 +- packages/client/src/os.ts | 51 ++++++++------------ 2 files changed, 21 insertions(+), 32 deletions(-) diff --git a/packages/client/src/components/MkUpdated.vue b/packages/client/src/components/MkUpdated.vue index bd88821956..6f5ca6618b 100644 --- a/packages/client/src/components/MkUpdated.vue +++ b/packages/client/src/components/MkUpdated.vue @@ -6,7 +6,7 @@
- + screenshot
{{ i18n.ts.gotIt }} diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index b25a3431b2..d3516bf4ca 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -7,6 +7,8 @@ import * as Misskey from "calckey-js"; import { apiUrl, url } from "@/config"; import MkPostFormDialog from "@/components/MkPostFormDialog.vue"; import MkWaitingDialog from "@/components/MkWaitingDialog.vue"; +import MkToast from '@/components/MkToast.vue'; +import MkDialog from '@/components/MkDialog.vue'; import { MenuItem } from "@/types/menu"; import { $i } from "@/account"; @@ -246,54 +248,41 @@ export function modalPageWindow(path: string) { } export function toast(message: string) { - popup( - defineAsyncComponent(() => import("@/components/MkToast.vue")), - { - message, - }, - {}, - "closed", - ); + popup(MkToast, { + message, + }, {}, 'closed'); } export function alert(props: { - type?: "error" | "info" | "success" | "warning" | "waiting" | "question"; + type?: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question'; title?: string | null; text?: string | null; }): Promise { return new Promise((resolve, reject) => { - popup( - defineAsyncComponent(() => import("@/components/MkDialog.vue")), - props, - { - done: (result) => { - resolve(); - }, + popup(MkDialog, props, { + done: result => { + resolve(); }, - "closed", - ); + }, 'closed'); }); } export function confirm(props: { - type: "error" | "info" | "success" | "warning" | "waiting" | "question"; + type: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question'; title?: string | null; text?: string | null; + okText?: string; + cancelText?: string; }): Promise<{ canceled: boolean }> { return new Promise((resolve, reject) => { - popup( - defineAsyncComponent(() => import("@/components/MkDialog.vue")), - { - ...props, - showCancelButton: true, + popup(MkDialog, { + ...props, + showCancelButton: true, + }, { + done: result => { + resolve(result ? result : { canceled: true }); }, - { - done: (result) => { - resolve(result ? result : { canceled: true }); - }, - }, - "closed", - ); + }, 'closed'); }); }