mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Fix leaked follow requests from Notifications popover to page
This commit is contained in:
parent
a697fb04df
commit
78a6f13380
1 changed files with 37 additions and 33 deletions
|
@ -379,39 +379,43 @@ function Notifications({ columnMode }) {
|
||||||
)}
|
)}
|
||||||
{snapStates.notifications.length ? (
|
{snapStates.notifications.length ? (
|
||||||
<>
|
<>
|
||||||
{snapStates.notifications.map((notification) => {
|
{snapStates.notifications
|
||||||
if (onlyMentions && notification.type !== 'mention') {
|
// This is leaked from Notifications popover
|
||||||
return null;
|
.filter((n) => n.type !== 'follow_request')
|
||||||
}
|
.map((notification) => {
|
||||||
const notificationDay = new Date(notification.createdAt);
|
if (onlyMentions && notification.type !== 'mention') {
|
||||||
const differentDay =
|
return null;
|
||||||
notificationDay.toDateString() !== currentDay.toDateString();
|
}
|
||||||
if (differentDay) {
|
const notificationDay = new Date(notification.createdAt);
|
||||||
currentDay = notificationDay;
|
const differentDay =
|
||||||
}
|
notificationDay.toDateString() !== currentDay.toDateString();
|
||||||
// if notificationDay is yesterday, show "Yesterday"
|
if (differentDay) {
|
||||||
// if notificationDay is before yesterday, show date
|
currentDay = notificationDay;
|
||||||
const heading =
|
}
|
||||||
notificationDay.toDateString() === yesterdayDate.toDateString()
|
// if notificationDay is yesterday, show "Yesterday"
|
||||||
? 'Yesterday'
|
// if notificationDay is before yesterday, show date
|
||||||
: niceDateTime(currentDay, {
|
const heading =
|
||||||
hideTime: true,
|
notificationDay.toDateString() ===
|
||||||
});
|
yesterdayDate.toDateString()
|
||||||
return (
|
? 'Yesterday'
|
||||||
<>
|
: niceDateTime(currentDay, {
|
||||||
{differentDay && <h2 class="timeline-header">{heading}</h2>}
|
hideTime: true,
|
||||||
<Notification
|
});
|
||||||
instance={instance}
|
return (
|
||||||
notification={notification}
|
<>
|
||||||
key={notification.id}
|
{differentDay && <h2 class="timeline-header">{heading}</h2>}
|
||||||
reload={() => {
|
<Notification
|
||||||
loadNotifications(true);
|
instance={instance}
|
||||||
loadFollowRequests();
|
notification={notification}
|
||||||
}}
|
key={notification.id}
|
||||||
/>
|
reload={() => {
|
||||||
</>
|
loadNotifications(true);
|
||||||
);
|
loadFollowRequests();
|
||||||
})}
|
}}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|
Loading…
Reference in a new issue