mirror of
https://github.com/usememos/memos.git
synced 2025-02-23 06:37:41 +01:00
chore: remove useCallback in fetching memo list
This commit is contained in:
parent
5a83f0c4fa
commit
cb569c99fd
@ -1,6 +1,6 @@
|
|||||||
import { Button } from "@usememos/mui";
|
import { Button } from "@usememos/mui";
|
||||||
import { ArrowDownIcon, LoaderIcon } from "lucide-react";
|
import { ArrowDownIcon, LoaderIcon } from "lucide-react";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import PullToRefresh from "react-simple-pull-to-refresh";
|
import PullToRefresh from "react-simple-pull-to-refresh";
|
||||||
import { DEFAULT_LIST_MEMOS_PAGE_SIZE } from "@/helpers/consts";
|
import { DEFAULT_LIST_MEMOS_PAGE_SIZE } from "@/helpers/consts";
|
||||||
import useResponsiveWidth from "@/hooks/useResponsiveWidth";
|
import useResponsiveWidth from "@/hooks/useResponsiveWidth";
|
||||||
@ -45,11 +45,11 @@ const PagedMemoList = (props: Props) => {
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
const refreshList = useCallback(async () => {
|
const refreshList = async () => {
|
||||||
memoList.reset();
|
memoList.reset();
|
||||||
setState((state) => ({ ...state, nextPageToken: "" }));
|
setState((state) => ({ ...state, nextPageToken: "" }));
|
||||||
fetchMoreMemos("");
|
fetchMoreMemos("");
|
||||||
}, [props.filter, props.pageSize]);
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
refreshList();
|
refreshList();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user