this repo has no description
0
fork

Configure Feed

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

Some sort of "garbage collection"

+25
+23
src/app.jsx
··· 68 68 counts[key] = Object.keys(states[key]).length; 69 69 }); 70 70 console.warn('STATE stats', counts); 71 + 72 + const { statuses } = states; 73 + const unmountedPosts = []; 74 + for (const key in statuses) { 75 + const $post = document.querySelector(`[data-state-post-id="${key}"]`); 76 + if (!$post) { 77 + unmountedPosts.push(key); 78 + } 79 + } 80 + console.warn('Unmounted posts', unmountedPosts.length, unmountedPosts); 71 81 }; 82 + 83 + // Experimental "garbage collection" for states 84 + // Every 5 minutes 85 + // Only posts for now 86 + setInterval(() => { 87 + const { statuses } = states; 88 + for (const key in statuses) { 89 + const $post = document.querySelector(`[data-state-post-id="${key}"]`); 90 + if (!$post) { 91 + delete states.statuses[key]; 92 + } 93 + } 94 + }, 5 * 60 * 1000); 72 95 73 96 // Preload icons 74 97 // There's probably a better way to do this
+1
src/components/media-post.jsx
··· 116 116 const filterTitleStr = filterInfo?.titlesStr; 117 117 return ( 118 118 <Parent 119 + data-state-post-id={sKey} 119 120 onMouseEnter={debugHover} 120 121 key={mediaKey} 121 122 data-spoiler-text={
+1
src/components/status.jsx
··· 973 973 974 974 return ( 975 975 <article 976 + data-state-post-id={sKey} 976 977 ref={(node) => { 977 978 statusRef.current = node; 978 979 // Use parent node if it's in focus