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