fix: clips and search sort

This commit is contained in:
Namekuji 2023-09-19 18:19:09 -04:00
parent e909190d81
commit 0745a4a862
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532
2 changed files with 4 additions and 0 deletions

View file

@ -155,6 +155,8 @@ export default define(meta, paramDef, async (ps, user) => {
.execute(prepared.note.select.byIds, [noteIds], { prepare: true })
.then((result) => result.rows.map(parseScyllaNote));
foundNotes.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
return (await Notes.packMany((await filter(foundNotes)), user)).slice(0, ps.limit);
}

View file

@ -163,6 +163,8 @@ export default define(meta, paramDef, async (ps, me) => {
});
}
notes.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
// The notes are checked for visibility and muted/blocked users when packed
found.push(...(await Notes.packMany(notes, me)));
start += chunkSize;