Browse Source

FIX | Reload notifications list

pull/25/head
Vitalik 9 months ago
parent
commit
5a3df97f71
  1. 11
      src/containers/Layout/topbar/Topbar.tsx

11
src/containers/Layout/topbar/Topbar.tsx

@ -13,6 +13,7 @@ import { @@ -13,6 +13,7 @@ import {
} from "@/shared";
import _ from "lodash";
import { SocketEvents } from "@/shared/events";
import { setItemTask } from "@/containers/Task/actions";
interface IProps {
containerHeight: number;
@ -68,11 +69,11 @@ const Topbar = (props: IProps) => { @@ -68,11 +69,11 @@ const Topbar = (props: IProps) => {
}
};
const onNewNotification = ({
notification,
}: SocketEvents["notification"]) => {
const newList = [notification, ...paginationList.items];
paginationList._setItems(newList);
const onNewNotification = ({}: SocketEvents["notification"]) => {
paginationList.resetFlatList();
setTimeout(() => {
paginationList.resetFlatList();
}, 100);
};
useSocketListener("notification", onNewNotification, [paginationList.items]);

Loading…
Cancel
Save