this repo has no description
0
fork

Configure Feed

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

Fix leaked follow requests from Notifications popover to page

+37 -33
+37 -33
src/pages/notifications.jsx
··· 379 379 )} 380 380 {snapStates.notifications.length ? ( 381 381 <> 382 - {snapStates.notifications.map((notification) => { 383 - if (onlyMentions && notification.type !== 'mention') { 384 - return null; 385 - } 386 - const notificationDay = new Date(notification.createdAt); 387 - const differentDay = 388 - notificationDay.toDateString() !== currentDay.toDateString(); 389 - if (differentDay) { 390 - currentDay = notificationDay; 391 - } 392 - // if notificationDay is yesterday, show "Yesterday" 393 - // if notificationDay is before yesterday, show date 394 - const heading = 395 - notificationDay.toDateString() === yesterdayDate.toDateString() 396 - ? 'Yesterday' 397 - : niceDateTime(currentDay, { 398 - hideTime: true, 399 - }); 400 - return ( 401 - <> 402 - {differentDay && <h2 class="timeline-header">{heading}</h2>} 403 - <Notification 404 - instance={instance} 405 - notification={notification} 406 - key={notification.id} 407 - reload={() => { 408 - loadNotifications(true); 409 - loadFollowRequests(); 410 - }} 411 - /> 412 - </> 413 - ); 414 - })} 382 + {snapStates.notifications 383 + // This is leaked from Notifications popover 384 + .filter((n) => n.type !== 'follow_request') 385 + .map((notification) => { 386 + if (onlyMentions && notification.type !== 'mention') { 387 + return null; 388 + } 389 + const notificationDay = new Date(notification.createdAt); 390 + const differentDay = 391 + notificationDay.toDateString() !== currentDay.toDateString(); 392 + if (differentDay) { 393 + currentDay = notificationDay; 394 + } 395 + // if notificationDay is yesterday, show "Yesterday" 396 + // if notificationDay is before yesterday, show date 397 + const heading = 398 + notificationDay.toDateString() === 399 + yesterdayDate.toDateString() 400 + ? 'Yesterday' 401 + : niceDateTime(currentDay, { 402 + hideTime: true, 403 + }); 404 + return ( 405 + <> 406 + {differentDay && <h2 class="timeline-header">{heading}</h2>} 407 + <Notification 408 + instance={instance} 409 + notification={notification} 410 + key={notification.id} 411 + reload={() => { 412 + loadNotifications(true); 413 + loadFollowRequests(); 414 + }} 415 + /> 416 + </> 417 + ); 418 + })} 415 419 </> 416 420 ) : ( 417 421 <>