Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fix: refresh while pagination (close AlistGo/alist#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed May 28, 2022
1 parent edc8e29 commit 8d62361
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/list/layout/files/menus/refresh.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import bus from "../../../../../utils/event-bus";
import { IContext } from "../../../context";

const Refresh = () => {
const { loggedIn } = useContext(IContext);
const { loggedIn, setPage, page } = useContext(IContext);
const { t } = useTranslation();
const { refresh } = useApi();
const toast = useToast();
Expand All @@ -28,6 +28,7 @@ const Refresh = () => {
isClosable: true,
});
if (res.code === 200) {
setPage({ ...page, page_num: 1 });
bus.emit("refresh");
}
});
Expand All @@ -42,4 +43,4 @@ const Refresh = () => {
);
};

export default Refresh;
export default Refresh;

0 comments on commit 8d62361

Please sign in to comment.