Improved scene actors filter.

This commit is contained in:
2024-01-07 23:44:33 +01:00
parent e32a366fff
commit 43949185c2
11 changed files with 456 additions and 90 deletions

View File

@@ -31,6 +31,7 @@ export function curateActor(actor, context = {}) {
isS3: actor.avatar.is_s3,
},
likes: actor.stashed,
...context.append?.[actor.id],
};
}
@@ -58,7 +59,7 @@ export async function fetchActorsById(actorIds, options = {}) {
]);
if (options.order) {
return actors.map((actorEntry) => curateActor(actorEntry));
return actors.map((actorEntry) => curateActor(actorEntry, { append: options.append }));
}
const curatedActors = actorIds.map((actorId) => {
@@ -69,7 +70,7 @@ export async function fetchActorsById(actorIds, options = {}) {
return null;
}
return curateActor(actor);
return curateActor(actor, { append: options.append });
}).filter(Boolean);
return curatedActors;