mirror of https://github.com/fantasticit/think.git
feat: imrove message
parent
f57fcbaf6b
commit
0479f3c8f6
|
@ -8,7 +8,7 @@ import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||||
import { useToggle } from 'hooks/use-toggle';
|
import { useToggle } from 'hooks/use-toggle';
|
||||||
import { EmptyBoxIllustration } from 'illustrations/empty-box';
|
import { EmptyBoxIllustration } from 'illustrations/empty-box';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import React, { useCallback, useEffect } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
|
|
||||||
import styles from './index.module.scss';
|
import styles from './index.module.scss';
|
||||||
import { Placeholder } from './placeholder';
|
import { Placeholder } from './placeholder';
|
||||||
|
@ -250,6 +250,5 @@ const MessageBox = () => {
|
||||||
|
|
||||||
export const Message = () => {
|
export const Message = () => {
|
||||||
const { loading, error } = useUser();
|
const { loading, error } = useUser();
|
||||||
return null;
|
return <DataRender loading={loading} error={error} normalContent={() => <MessageBox />} />;
|
||||||
// return <DataRender loading={loading} error={error} normalContent={() => <MessageBox />} />;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -61,7 +61,7 @@ export const useUnreadMessages = () => {
|
||||||
const { data, error, isLoading, refetch } = useQuery(
|
const { data, error, isLoading, refetch } = useQuery(
|
||||||
[MessageApiDefinition.getUnread.client(), page],
|
[MessageApiDefinition.getUnread.client(), page],
|
||||||
() => getMessagesApi('getUnread')(page),
|
() => getMessagesApi('getUnread')(page),
|
||||||
{ keepPreviousData: true }
|
{ keepPreviousData: true, refetchInterval: 500 }
|
||||||
);
|
);
|
||||||
|
|
||||||
const readMessage = useCallback(
|
const readMessage = useCallback(
|
||||||
|
|
Loading…
Reference in New Issue