mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 00:56:23 +01: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 Link from '../components/link';
|
||||||
import Timeline from '../components/timeline';
|
import Timeline from '../components/timeline';
|
||||||
import { api } from '../utils/api';
|
import { api } from '../utils/api';
|
||||||
|
import { fixNotifications } from '../utils/group-notifications';
|
||||||
import { saveStatus } from '../utils/states';
|
import { saveStatus } from '../utils/states';
|
||||||
import useTitle from '../utils/useTitle';
|
import useTitle from '../utils/useTitle';
|
||||||
|
|
||||||
|
@ -30,6 +31,8 @@ function Mentions({ columnMode, ...props }) {
|
||||||
const results = await mentionsIterator.current.next();
|
const results = await mentionsIterator.current.next();
|
||||||
let { value } = results;
|
let { value } = results;
|
||||||
if (value?.length) {
|
if (value?.length) {
|
||||||
|
value = fixNotifications(value);
|
||||||
|
|
||||||
if (firstLoad) {
|
if (firstLoad) {
|
||||||
latestItem.current = value[0].id;
|
latestItem.current = value[0].id;
|
||||||
console.log('First load', latestItem.current);
|
console.log('First load', latestItem.current);
|
||||||
|
|
|
@ -9,7 +9,7 @@ const notificationTypeKeys = {
|
||||||
poll: ['status'],
|
poll: ['status'],
|
||||||
update: ['status'],
|
update: ['status'],
|
||||||
};
|
};
|
||||||
function fixNotifications(notifications) {
|
export function fixNotifications(notifications) {
|
||||||
return notifications.filter((notification) => {
|
return notifications.filter((notification) => {
|
||||||
const { type, id, createdAt } = notification;
|
const { type, id, createdAt } = notification;
|
||||||
if (!type) {
|
if (!type) {
|
||||||
|
|
Loading…
Reference in a new issue