From 044d3d76e7c84726518bb17e344cf6df1080c1c0 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 31 Oct 2023 16:16:39 +0000 Subject: [PATCH] actually fix #118 `note.fileIds` is an array, it's always going to be truthy; we need to check the length, like a similar `if` does just a few lines above --- packages/backend/src/server/api/endpoints/users/notes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 9e87d9a235..31ad3e68d6 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -123,7 +123,7 @@ export default class extends Endpoint { // eslint- } } - if (ps.withFiles && !note.fileIds) return false; + if (ps.withFiles && note.fileIds.length === 0) return false; if (note.channel?.isSensitive && !isSelf) return false; if (note.visibility === 'specified' && (!me || (me.id !== note.userId && !note.visibleUserIds.some(v => v === me.id)))) return false;