| 4683 | } |
| 4684 | |
| 4685 | function activeMentionsForQuestion(question) { |
| 4686 | const selected = state.chatMentions.filter((mention) => { |
| 4687 | const nodeId = mention.node_id || ""; |
| 4688 | const title = mention.title || ""; |
| 4689 | return (nodeId && question.includes(nodeId)) || (title && question.includes(title)); |
| 4690 | }); |
| 4691 | return selected.map((mention) => ({ |
| 4692 | node_id: mention.node_id, |
| 4693 | title: mention.title, |
| 4694 | node_type: mention.node_type |
| 4695 | })); |
| 4696 | } |
| 4697 | |
| 4698 | function clearChatMentions() { |
| 4699 | state.chatMentions = []; |