feat(StorePage): add resetPagination function to reset page index and page size when changing tabs
This commit is contained in:
parent
b9b8937eda
commit
7bfce4cd1d
1 changed files with 7 additions and 0 deletions
|
|
@ -157,6 +157,11 @@ export default function StorePage(): JSX.Element {
|
|||
setTabId("");
|
||||
}, []);
|
||||
|
||||
function resetPagination() {
|
||||
setPageIndex(1);
|
||||
setPageSize(12);
|
||||
}
|
||||
|
||||
return (
|
||||
<PageLayout
|
||||
title="Langflow Store"
|
||||
|
|
@ -230,6 +235,7 @@ export default function StorePage(): JSX.Element {
|
|||
<button
|
||||
disabled={loading}
|
||||
onClick={() => {
|
||||
resetPagination();
|
||||
setTabActive("Flows");
|
||||
}}
|
||||
className={
|
||||
|
|
@ -244,6 +250,7 @@ export default function StorePage(): JSX.Element {
|
|||
<button
|
||||
disabled={loading}
|
||||
onClick={() => {
|
||||
resetPagination();
|
||||
setTabActive("Components");
|
||||
}}
|
||||
className={
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue