chore: format

This commit is contained in:
老周部落 2024-03-31 06:44:00 +08:00
parent f346d2e2f6
commit 46bf02cdd5
No known key found for this signature in database
GPG key ID: C72181CD85C6B738

View file

@ -1016,7 +1016,7 @@ function deleteDraft() {
/** /**
* @returns whether the file is described * @returns whether the file is described
*/ */
function openFileDescriptionWindow(file: entities.DriveFile) { function openFileDescriptionWindow(file: entities.DriveFile) {
return new Promise<boolean>((resolve, reject) => { return new Promise<boolean>((resolve, reject) => {
os.popup( os.popup(
XMediaCaption, XMediaCaption,
@ -1034,22 +1034,23 @@ function deleteDraft() {
resolve(false); resolve(false);
return; return;
} }
const comment = const comment = result.result.length === 0 ? null : result.result;
result.result.length === 0 ? null : result.result; os.api("drive/files/update", {
os.api("drive/files/update", {
fileId: file.id, fileId: file.id,
comment, comment,
}).then(() => { })
resolve(true); .then(() => {
file.comment = comment; resolve(true);
}).catch((err: unknown) => { file.comment = comment;
reject(err); })
}); .catch((err: unknown) => {
reject(err);
});
}, },
}, },
"closed", "closed",
); );
}) });
} }
async function post() { async function post() {
@ -1101,7 +1102,9 @@ async function post() {
} }
isFirstPostAttempt = false; isFirstPostAttempt = false;
// Continue if all files have alt-text added. // 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; return;
} }
} }
@ -1130,7 +1133,9 @@ async function post() {
} }
} }
// Continue if all files have alt-text added. // 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; return;
} }
} }