feat: imrove message

This commit is contained in:
fantasticit 2022-05-24 17:49:31 +08:00
parent f57fcbaf6b
commit 0479f3c8f6
2 changed files with 3 additions and 4 deletions

View File

@ -8,7 +8,7 @@ import { IsOnMobile } from 'hooks/use-on-mobile';
import { useToggle } from 'hooks/use-toggle';
import { EmptyBoxIllustration } from 'illustrations/empty-box';
import Link from 'next/link';
import React, { useCallback, useEffect } from 'react';
import React, { useCallback } from 'react';
import styles from './index.module.scss';
import { Placeholder } from './placeholder';
@ -250,6 +250,5 @@ const MessageBox = () => {
export const Message = () => {
const { loading, error } = useUser();
return null;
// return <DataRender loading={loading} error={error} normalContent={() => <MessageBox />} />;
return <DataRender loading={loading} error={error} normalContent={() => <MessageBox />} />;
};

View File

@ -61,7 +61,7 @@ export const useUnreadMessages = () => {
const { data, error, isLoading, refetch } = useQuery(
[MessageApiDefinition.getUnread.client(), page],
() => getMessagesApi('getUnread')(page),
{ keepPreviousData: true }
{ keepPreviousData: true, refetchInterval: 500 }
);
const readMessage = useCallback(