Skip to content

Commit 3ef8890

Browse files
committed
dedup mentions client side by fragment id
1 parent 983fabf commit 3ef8890

File tree

1 file changed

+8
-0
lines changed
  • src/packages/frontend/editors/markdown-input

1 file changed

+8
-0
lines changed

src/packages/frontend/editors/markdown-input/mentions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ interface Mention {
1313
fragment_id?: string;
1414
}
1515

16+
const seenFragmentIds = new Set<string>();
17+
1618
export async function submit_mentions(
1719
project_id: string,
1820
path: string,
@@ -27,6 +29,12 @@ export async function submit_mentions(
2729
// Ignore all language model mentions, they are processed by the chat actions in the frontend
2830
continue;
2931
}
32+
if (fragment_id) {
33+
if (seenFragmentIds.has(fragment_id)) {
34+
continue;
35+
}
36+
seenFragmentIds.add(fragment_id);
37+
}
3038
try {
3139
await webapp_client.query_client.query({
3240
query: {

0 commit comments

Comments
 (0)