this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Auto-scroll to selected author

+31
+31
src/pages/catchup.jsx
··· 515 515 authors, 516 516 ]); 517 517 518 + const prevSelectedAuthorMissing = useRef(false); 519 + useEffect(() => { 520 + console.log({ 521 + prevSelectedAuthorMissing, 522 + selectedAuthor, 523 + authors, 524 + }); 525 + let timer; 526 + if (selectedAuthor) { 527 + if (authors[selectedAuthor]) { 528 + if (prevSelectedAuthorMissing.current) { 529 + timer = setTimeout(() => { 530 + authorsListParent.current 531 + .querySelector(`[data-author="${selectedAuthor}"]`) 532 + ?.scrollIntoView({ 533 + behavior: 'smooth', 534 + inline: 'center', 535 + }); 536 + }, 500); 537 + prevSelectedAuthorMissing.current = false; 538 + } 539 + } else { 540 + prevSelectedAuthorMissing.current = true; 541 + } 542 + } 543 + return () => { 544 + clearTimeout(timer); 545 + }; 546 + }, [selectedAuthor, authors]); 547 + 518 548 return ( 519 549 <div 520 550 ref={scrollableRef} ··· 907 937 {authorCountsList.map((author) => ( 908 938 <label 909 939 class="filter-author" 940 + data-author={author} 910 941 key={`${author}-${authorCounts[author]}`} 911 942 // Preact messed up the order sometimes, need additional key besides just `author` 912 943 // https://github.com/preactjs/preact/issues/2849