refactor: constrain type

This commit is contained in:
Namekuji 2023-09-05 18:34:58 -04:00
parent 6063f4d7ab
commit 065b889ccb
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532

View file

@ -132,11 +132,11 @@ export default define(meta, paramDef, async (ps, user) => {
blockerIds.includes(n.notifierId))
),
);
if (
ps.directOnly &&
ps.includeTypes?.every((t) => ["mention", "reply"].includes(t))
) {
filtered = filtered.filter(({ entityId }) => !!entityId);
if (ps.directOnly) {
filtered = filtered.filter(
({ entityId, type }) =>
entityId && ["mention", "reply"].includes(type),
);
let notes = await client
.execute(
prepared.note.select.byIds,