- Shipped
- 10 Julai 2026, 01:34 UTC
- Author
- kamo
- Commit
- 8e82294
Selecting a row checkbox called setSelectedIds(new Set(...)), which was listed in loadLeads' useCallback deps. That gave loadLeads a new identity on every click, re-firing the `useEffect(() => loadLeads(), [loadLeads])` mount effect -> setLoading(true) blanked rowData to [] and refetched, so the just-made selection was wiped and the grid appeared to "refresh". Decouple loadLeads from selectedIds via a latest-value ref (the same "prevent circular updates" pattern already used in this file): loadLeads now reads selectedIdsRef.current for reselection and has stable [] deps, so selecting a checkbox no longer triggers a reload. Also stabilizes the realtime-reconnect and post-delete loadLeads callers.