mirror of https://github.com/fantasticit/think.git
client: optimize fetch collector
This commit is contained in:
parent
f317086d7a
commit
42e05bec0f
|
@ -31,6 +31,7 @@ export const getCollectedWikis = (cookie = null): Promise<IWikiWithIsMember[]> =
|
||||||
export const useCollectedWikis = () => {
|
export const useCollectedWikis = () => {
|
||||||
const { data, error, isLoading, refetch } = useQuery(CollectorApiDefinition.wikis.client(), getCollectedWikis, {
|
const { data, error, isLoading, refetch } = useQuery(CollectorApiDefinition.wikis.client(), getCollectedWikis, {
|
||||||
staleTime: 500,
|
staleTime: 500,
|
||||||
|
enabled: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -118,7 +118,11 @@ const RecentDocs = () => {
|
||||||
|
|
||||||
const Page: NextPage = () => {
|
const Page: NextPage = () => {
|
||||||
const [visible, toggleVisible] = useToggle(false);
|
const [visible, toggleVisible] = useToggle(false);
|
||||||
const { data: staredWikis, loading, error } = useCollectedWikis();
|
const { data: staredWikis, loading, error, refresh } = useCollectedWikis();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
refresh();
|
||||||
|
}, [refresh]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SingleColumnLayout>
|
<SingleColumnLayout>
|
||||||
|
|
Loading…
Reference in New Issue