diff options
| author | dakkar <dakkar@thenautilus.net> | 2023-10-31 16:16:39 +0000 |
|---|---|---|
| committer | dakkar <dakkar@thenautilus.net> | 2023-10-31 16:16:39 +0000 |
| commit | 044d3d76e7c84726518bb17e344cf6df1080c1c0 (patch) | |
| tree | 587c8ce2dac92bf8a622a6d0d33d5b1313f729c5 /packages/backend/src/server/api | |
| parent | try to fix #118 (diff) | |
| download | sharkey-044d3d76e7c84726518bb17e344cf6df1080c1c0.tar.gz sharkey-044d3d76e7c84726518bb17e344cf6df1080c1c0.tar.bz2 sharkey-044d3d76e7c84726518bb17e344cf6df1080c1c0.zip | |
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
Diffstat (limited to 'packages/backend/src/server/api')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/users/notes.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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<typeof meta, typeof paramDef> { // 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; |