()
| 422 | |
| 423 | let ignore = false; |
| 424 | const loadCandidates = async () => { |
| 425 | const nextCandidates = await getMentionCandidates(activeMention.query); |
| 426 | if (ignore) return; |
| 427 | |
| 428 | setMentionCandidates(nextCandidates); |
| 429 | setMentionSelectedIndex((currentIndex) => { |
| 430 | if (nextCandidates.length === 0) { |
| 431 | return 0; |
| 432 | } |
| 433 | return Math.min(currentIndex, nextCandidates.length - 1); |
| 434 | }); |
| 435 | }; |
| 436 | |
| 437 | void loadCandidates(); |
| 438 |
no test coverage detected