mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-26 03:05:41 +03:00
Mentions also need fixNotifications
It's also from notifications API
This commit is contained in:
parent
b9058c6e3d
commit
9bf77fa97a
2 changed files with 4 additions and 1 deletions
|
@ -4,6 +4,7 @@ import { useSearchParams } from 'react-router-dom';
|
|||
import Link from '../components/link';
|
||||
import Timeline from '../components/timeline';
|
||||
import { api } from '../utils/api';
|
||||
import { fixNotifications } from '../utils/group-notifications';
|
||||
import { saveStatus } from '../utils/states';
|
||||
import useTitle from '../utils/useTitle';
|
||||
|
||||
|
@ -30,6 +31,8 @@ function Mentions({ columnMode, ...props }) {
|
|||
const results = await mentionsIterator.current.next();
|
||||
let { value } = results;
|
||||
if (value?.length) {
|
||||
value = fixNotifications(value);
|
||||
|
||||
if (firstLoad) {
|
||||
latestItem.current = value[0].id;
|
||||
console.log('First load', latestItem.current);
|
||||
|
|
|
@ -9,7 +9,7 @@ const notificationTypeKeys = {
|
|||
poll: ['status'],
|
||||
update: ['status'],
|
||||
};
|
||||
function fixNotifications(notifications) {
|
||||
export function fixNotifications(notifications) {
|
||||
return notifications.filter((notification) => {
|
||||
const { type, id, createdAt } = notification;
|
||||
if (!type) {
|
||||
|
|
Loading…
Reference in a new issue