Skip to content

Commit

Permalink
itemsBeingProcessed fix & spinner added
Browse files Browse the repository at this point in the history
  • Loading branch information
jhweir committed Jan 23, 2025
1 parent 40cda2d commit c3ccf49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/utils/src/synergy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,13 @@ async function processItemsAndAddToConversation(
) {
// update processing items state
processing = true;
const itemIds = JSON.stringify(unprocessedItems.map((item) => item.baseExpression));
setProcessing({ author: "me", channel: channelId, items: itemIds });
const itemIds = unprocessedItems.map((item) => item.baseExpression);
const client = await getAd4mClient();
const me = await client.agent.me();
setProcessing({ author: me.did, channel: channelId, items: itemIds });
// notify other agents that we are processing
await neighbourhood.sendBroadcastU({
links: [{ source: channelId, predicate: "processing-items-started", target: itemIds }],
links: [{ source: channelId, predicate: "processing-items-started", target: JSON.stringify(itemIds) }],
});
// gather up all new perspective links so they can be commited in a single transaction at the end of the function
const newLinks = [] as any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export default function TimelineColumn({
<j-flex a="center" gap="300">
<j-text nomargin>{processing.items.length} items being processed by</j-text>
<Avatar did={processing.author} showName />
<j-spinner size="xs" />
</j-flex>
</j-box>
)}
Expand Down

0 comments on commit c3ccf49

Please sign in to comment.