[backend] Use correct identifier for filteredNoteCache

This commit is contained in:
Laura Hausmann 2023-11-27 22:22:24 +01:00
parent 436fb826ac
commit 913f1659b3
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -19,6 +19,6 @@ export async function isFiltered(note: Note, user: { id: User["id"] } | null | u
if (!profile || profile.mutedWords.length < 1) return false; if (!profile || profile.mutedWords.length < 1) return false;
const ts = (note.updatedAt ?? note.createdAt) as Date | string; const ts = (note.updatedAt ?? note.createdAt) as Date | string;
const identifier = (typeof ts === "string" ? new Date(ts) : ts)?.getTime() ?? '0'; const identifier = (typeof ts === "string" ? new Date(ts) : ts)?.getTime() ?? '0';
return filteredNoteCache.fetch(`${note.id}:${ts}:${user.id}`, return filteredNoteCache.fetch(`${note.id}:${identifier}:${user.id}`,
() => getWordHardMute(note, user, unique(profile!.mutedWords))); () => getWordHardMute(note, user, unique(profile!.mutedWords)));
} }