refactor: remove duplicate code (#8895)

This commit is contained in:
Johann150
2022-06-27 14:48:10 +02:00
committed by GitHub
parent 0ec266abf7
commit bc3ae901cc
12 changed files with 41 additions and 64 deletions

View File

@@ -0,0 +1,15 @@
export function isUserRelated(note: any, userIds: Set<string>): boolean {
if (userIds.has(note.userId)) {
return true;
}
if (note.reply != null && userIds.has(note.reply.userId)) {
return true;
}
if (note.renote != null && userIds.has(note.renote.userId)) {
return true;
}
return false;
}