chore (backend): add FIXME comment to questionable if statements
This commit is contained in:
parent
24e6e31b2b
commit
40a4109c76
2 changed files with 4 additions and 2 deletions
|
@ -59,6 +59,7 @@ export async function importCkPost(
|
|||
userId: user.id,
|
||||
});
|
||||
|
||||
// FIXME: What is this condition?
|
||||
if (note != null && (note.fileIds?.length || 0) < files.length) {
|
||||
const update: Partial<Note> = {};
|
||||
update.fileIds = files.map((x) => x.id);
|
||||
|
@ -81,7 +82,7 @@ export async function importCkPost(
|
|||
});
|
||||
logger.info("Post updated");
|
||||
}
|
||||
if (!note) {
|
||||
if (note == null) {
|
||||
note = await create(user, {
|
||||
createdAt: createdAt,
|
||||
files: files.length === 0 ? undefined : files,
|
||||
|
|
|
@ -85,6 +85,7 @@ export async function importMastoPost(
|
|||
userId: user.id,
|
||||
});
|
||||
|
||||
// FIXME: What is this condition?
|
||||
if (note != null && (note.fileIds?.length || 0) < files.length) {
|
||||
const update: Partial<Note> = {};
|
||||
update.fileIds = files.map((x) => x.id);
|
||||
|
@ -107,7 +108,7 @@ export async function importMastoPost(
|
|||
});
|
||||
logger.info("Post updated");
|
||||
}
|
||||
if (!note) {
|
||||
if (note == null) {
|
||||
note = await create(user, {
|
||||
createdAt: isRenote
|
||||
? new Date(post.published)
|
||||
|
|
Loading…
Reference in a new issue