Skip to content

Commit

Permalink
actually fix transfem-org#118
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
dakkar committed Oct 31, 2023
1 parent 111863b commit 044d3d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/backend/src/server/api/endpoints/users/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 044d3d7

Please sign in to comment.