fix(web): keep highlights card active index in range on refresh (#1334)

Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
This commit is contained in:
Abhay Singh 2026-08-12 20:55:01 +05:30 committed by GitHub
parent a7efd817ec
commit f163c932cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,8 +92,8 @@ export function HighlightsCard({
if (isReplyOpen) replyInputRef.current?.focus()
}, [isReplyOpen])
// biome-ignore lint/correctness/useExhaustiveDependencies: intentionally re-run when items changes
useEffect(() => {
setActiveIndex((i) => Math.min(i, Math.max(items.length - 1, 0)))
setIsReplyOpen(false)
setReplyText("")
setIsExpanded(false)