mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
notifications: updating lastSeen when list is opened
This commit is contained in:
parent
a39d000ff2
commit
97590d88af
7 changed files with 88 additions and 4 deletions
|
@ -1,8 +1,9 @@
|
|||
import React, { FC } from 'react';
|
||||
import React, { FC, useEffect } from 'react';
|
||||
|
||||
import { LoaderCircle } from '~/components/input/LoaderCircle';
|
||||
import { NotificationComment } from '~/components/notifications/NotificationComment';
|
||||
import { useNotificationsList } from '~/hooks/notifications/useNotificationsList';
|
||||
import { useNotifications } from '~/utils/providers/NotificationProvider';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
|
@ -10,6 +11,11 @@ interface NotificationListProps {}
|
|||
|
||||
const NotificationList: FC<NotificationListProps> = () => {
|
||||
const { isLoading, items } = useNotificationsList();
|
||||
const { markAsRead } = useNotifications();
|
||||
|
||||
useEffect(() => {
|
||||
return () => markAsRead();
|
||||
}, []);
|
||||
|
||||
if (isLoading) {
|
||||
return <LoaderCircle />;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue