this repo has no description
0
fork

Configure Feed

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

Let's try this out

Sometimes the logic gets confusing

+5 -3
+5 -3
src/pages/notifications.jsx
··· 54 54 55 55 const notificationsIterator = useRef(); 56 56 async function fetchNotifications(firstLoad) { 57 - states.notificationsShowNew = false; // Hide "new notifications" button early 58 - 59 57 if (firstLoad || !notificationsIterator.current) { 60 58 // Reset iterator 61 59 notificationsIterator.current = masto.v1.notifications.list({ ··· 176 174 // } 177 175 // }, [nearReachEnd, showMore]); 178 176 177 + const [showNew, setShowNew] = useState(false); 178 + 179 179 const loadUpdates = useCallback( 180 180 ({ disableIdleCheck = false } = {}) => { 181 181 console.log('✨ Load updates', { ··· 195 195 uiState !== 'loading' 196 196 ) { 197 197 loadNotifications(true); 198 + } else { 199 + setShowNew(snapStates.notificationsShowNew); 198 200 } 199 201 }, 200 202 [snapStates.notificationsShowNew, snapStates.settings.autoRefresh, uiState], ··· 291 293 {/* <Loader hidden={uiState !== 'loading'} /> */} 292 294 </div> 293 295 </div> 294 - {snapStates.notificationsShowNew && uiState !== 'loading' && ( 296 + {showNew && uiState !== 'loading' && ( 295 297 <button 296 298 class="updates-button shiny-pill" 297 299 type="button"