Fix leaked follow requests from Notifications popover to page

This commit is contained in:
Lim Chee Aun 2023-10-09 19:46:07 +08:00
parent a697fb04df
commit 78a6f13380

View file

@ -379,7 +379,10 @@ function Notifications({ columnMode }) {
)}
{snapStates.notifications.length ? (
<>
{snapStates.notifications.map((notification) => {
{snapStates.notifications
// This is leaked from Notifications popover
.filter((n) => n.type !== 'follow_request')
.map((notification) => {
if (onlyMentions && notification.type !== 'mention') {
return null;
}
@ -392,7 +395,8 @@ function Notifications({ columnMode }) {
// if notificationDay is yesterday, show "Yesterday"
// if notificationDay is before yesterday, show date
const heading =
notificationDay.toDateString() === yesterdayDate.toDateString()
notificationDay.toDateString() ===
yesterdayDate.toDateString()
? 'Yesterday'
: niceDateTime(currentDay, {
hideTime: true,