this repo has no description
0
fork

Configure Feed

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

Remember replies toggle state during the "session"

+12 -1
+12 -1
src/pages/status.jsx
··· 33 33 const LIMIT = 40; 34 34 const THREAD_LIMIT = 20; 35 35 36 + let cachedRepliesToggle = {}; 36 37 let cachedStatusesMap = {}; 37 38 function resetScrollPosition(id) { 38 39 delete cachedStatusesMap[id]; ··· 293 294 states.scrollPositions = {}; 294 295 states.reloadStatusPage = 0; 295 296 cachedStatusesMap = {}; 297 + cachedRepliesToggle = {}; 296 298 }; 297 299 }, []); 298 300 ··· 870 872 871 873 const open = 872 874 (!hasParentThread || replies.length === 1) && (isBrief || !hasManyStatuses); 875 + const openBefore = cachedRepliesToggle[replies[0].id]; 873 876 874 877 return ( 875 - <details class="replies" open={open}> 878 + <details 879 + class="replies" 880 + open={openBefore || open} 881 + onToggle={(e) => { 882 + const { open } = e.target; 883 + // use first reply as ID 884 + cachedRepliesToggle[replies[0].id] = open; 885 + }} 886 + > 876 887 <summary hidden={open}> 877 888 <span class="avatars"> 878 889 {accounts.map((a) => (