From 46bf02cdd591df1bed64677ccb15e358aa6b921d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Sun, 31 Mar 2024 06:44:00 +0800 Subject: [PATCH] chore: format --- packages/client/src/components/MkPostForm.vue | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index fee812317e..ffeb1a1cc5 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -1016,7 +1016,7 @@ function deleteDraft() { /** * @returns whether the file is described */ - function openFileDescriptionWindow(file: entities.DriveFile) { +function openFileDescriptionWindow(file: entities.DriveFile) { return new Promise((resolve, reject) => { os.popup( XMediaCaption, @@ -1034,22 +1034,23 @@ function deleteDraft() { resolve(false); return; } - const comment = - result.result.length === 0 ? null : result.result; - os.api("drive/files/update", { + const comment = result.result.length === 0 ? null : result.result; + os.api("drive/files/update", { fileId: file.id, comment, - }).then(() => { - resolve(true); - file.comment = comment; - }).catch((err: unknown) => { - reject(err); - }); + }) + .then(() => { + resolve(true); + file.comment = comment; + }) + .catch((err: unknown) => { + reject(err); + }); }, }, "closed", ); - }) + }); } async function post() { @@ -1101,7 +1102,9 @@ async function post() { } isFirstPostAttempt = false; // Continue if all files have alt-text added. - if (files.value.some((f) => f.comment == null || f.comment.length === 0)) { + if ( + files.value.some((f) => f.comment == null || f.comment.length === 0) + ) { return; } } @@ -1130,7 +1133,9 @@ async function post() { } } // Continue if all files have alt-text added. - if (files.value.some((f) => f.comment == null || f.comment.length === 0)) { + if ( + files.value.some((f) => f.comment == null || f.comment.length === 0) + ) { return; } }