contextController: fix hydration again

This commit is contained in:
Alex Gleason 2024-06-05 11:10:58 -05:00
parent eead178c6a
commit 18d3363b65
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 9 additions and 4 deletions

View File

@ -215,17 +215,22 @@ const contextController: AppController = async (c) => {
}
if (event) {
const [ancestors, descendants] = await Promise.all([
getAncestors(store, event).then(renderStatuses),
getDescendants(store, event.id).then(renderStatuses),
const [ancestorEvents, descendantEvents] = await Promise.all([
getAncestors(store, event),
getDescendants(store, event.id),
]);
await hydrateEvents({
events: [...ancestors, ...descendants],
events: [...ancestorEvents, ...descendantEvents],
signal: c.req.raw.signal,
store,
});
const [ancestors, descendants] = await Promise.all([
renderStatuses(ancestorEvents),
renderStatuses(descendantEvents),
]);
return c.json({ ancestors, descendants });
}