chore (client): fix type errors

This commit is contained in:
naskya 2024-04-22 07:14:56 +09:00
parent fbdc068115
commit 9a4988eaad
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -1046,14 +1046,14 @@ function openFileDescriptionWindow(file: entities.DriveFile) {
resolve(false); resolve(false);
return; return;
} }
const comment = result.result.length === 0 ? null : result.result; const comment = 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(() => { .then(() => {
resolve(true); resolve(true);
file.comment = comment; file.comment = comment ?? null;
}) })
.catch((err: unknown) => { .catch((err: unknown) => {
reject(err); reject(err);