Skip to content

Commit

Permalink
Merge commit '0eec265992d512f7da6d88a10a064777a0f15eb0' into new-syne…
Browse files Browse the repository at this point in the history
…rgy-processing-approach
  • Loading branch information
lucksus committed Jan 21, 2025
2 parents 84aa4dd + 0eec265 commit 39c24c1
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions views/synergy-demo-view/src/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export async function getConversationData(perspective, channelId, match?, setMat
const subgroups = (await ConversationSubgroup.query(perspective, {
source: conversation.baseExpression,
})) as any;
const conversationItems = await getSynergyItems(perspective, conversation.baseExpression);
const subgroupsWithData = await Promise.all(
subgroups.map(async (subgroup, subgroupIndex) => {
if (match && subgroup.baseExpression === match.baseExpression) {
Expand All @@ -53,16 +52,7 @@ export async function getConversationData(perspective, channelId, match?, setMat
}
subgroup.groupType = "subgroup";
subgroup.topics = await findTopics(perspective, subgroup.baseExpression);
const nextSubgroup = subgroups[subgroupIndex + 1];
const subgroupItems = conversationItems.filter(
(item) =>
// item after subgroup start
new Date(item.timestamp).getTime() > new Date(subgroup.positionTimestamp).getTime() &&
// either no subgroup after or item before next subgroup
(!nextSubgroup ||
new Date(item.timestamp).getTime() <
new Date(nextSubgroup.positionTimestamp).getTime())
);
const subgroupItems = await getSynergyItems(perspective, subgroup.baseExpression);
if (subgroupItems.length) {
subgroup.start = subgroupItems[0].timestamp;
subgroup.end = subgroupItems[subgroupItems.length - 1].timestamp;
Expand Down

0 comments on commit 39c24c1

Please sign in to comment.