diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 5a12e3ae6d..24eb81beca 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -101,7 +101,7 @@ export const apiWithDialog = (< }); export function promiseDialog>( - promise: T, + promise: T | (() => T), onSuccess?: ((res: Awaited) => void) | null, onFailure?: ((err: Misskey.api.APIError) => void) | null, text?: string, @@ -109,6 +109,10 @@ export function promiseDialog>( const showing = ref(true); const success = ref(false); + if (typeof(promise) === 'function') { + promise = promise(); + } + promise.then(res => { if (onSuccess) { showing.value = false;