From 8607eda1f8a7b39c005242926b934584654c3ed1 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Tue, 14 Sep 2021 08:18:09 +0000 Subject: [PATCH] separate page change from other sort/filter options. --- src/Builds.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Builds.js b/src/Builds.js index 20ac762..2f997e3 100644 --- a/src/Builds.js +++ b/src/Builds.js @@ -59,6 +59,7 @@ function Builds(p) { useEffect(()=>{ setFinished(false) + setPage(0) axios.get(`${BACKENDURL}/getBuilds?sort_type=${sort}${filter_type!==""?`&filter_type=${filter_type}`:""}${filter_type!==""?`&filter=${encodeURI(filter)}`:""}${page!==0?`&offset=${page}`:""}`) .then((data)=>{ setBuilds(data.data) @@ -69,7 +70,21 @@ function Builds(p) { .finally(()=>{ setFinished(true) }) - },[BACKENDURL,sort,filter_type,filter,page]) + },[BACKENDURL,sort,filter_type,filter]) + + useEffect(()=>{ + setFinished(false) + axios.get(`${BACKENDURL}/getBuilds?sort_type=${sort}${filter_type!==""?`&filter_type=${filter_type}`:""}${filter_type!==""?`&filter=${encodeURI(filter)}`:""}${page!==0?`&offset=${page}`:""}`) + .then((data)=>{ + setBuilds(data.data) + }) + .catch((err)=>{ + + }) + .finally(()=>{ + setFinished(true) + }) + },[page]) return <>