Skip to content

Commit b7c2dc5

Browse files
committed
fix(chat): avoid Array.at in the mention range merge
1 parent 4a5d1e8 commit b7c2dc5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/home/components/user-message-content

‎apps/sim/app/workspace/[workspaceId]/home/components/user-message-content/utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function computeMentionRanges(text: string, contexts: ChatMessageContext[
4848
ranges.sort((a, b) => a.start - b.start || b.end - a.end)
4949
const merged: MentionRange[] = []
5050
for (const range of ranges) {
51-
if (range.start >= (merged.at(-1)?.end ?? 0)) merged.push(range)
51+
if (range.start >= (merged[merged.length - 1]?.end ?? 0)) merged.push(range)
5252
}
5353
return merged
5454
}

0 commit comments

Comments
 (0)