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("");
|
setTabId("");
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
function resetPagination() {
|
||||||
|
setPageIndex(1);
|
||||||
|
setPageSize(12);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageLayout
|
<PageLayout
|
||||||
title="Langflow Store"
|
title="Langflow Store"
|
||||||
|
|
@ -230,6 +235,7 @@ export default function StorePage(): JSX.Element {
|
||||||
<button
|
<button
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
resetPagination();
|
||||||
setTabActive("Flows");
|
setTabActive("Flows");
|
||||||
}}
|
}}
|
||||||
className={
|
className={
|
||||||
|
|
@ -244,6 +250,7 @@ export default function StorePage(): JSX.Element {
|
||||||
<button
|
<button
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
resetPagination();
|
||||||
setTabActive("Components");
|
setTabActive("Components");
|
||||||
}}
|
}}
|
||||||
className={
|
className={
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue