This commit is contained in:
parent
9d847449e8
commit
ba506a59db
@ -130,7 +130,7 @@ export default function PlayerScores({ initialScoreData, initialSearch, player,
|
|||||||
(page: number) => {
|
(page: number) => {
|
||||||
return `/player/${player.id}/${pageState.sort}/${page}${isSearchActive ? `?search=${debouncedSearchTerm}` : ""}`;
|
return `/player/${player.id}/${pageState.sort}/${page}${isSearchActive ? `?search=${debouncedSearchTerm}` : ""}`;
|
||||||
},
|
},
|
||||||
[debouncedSearchTerm, player.id, pageState.sort]
|
[debouncedSearchTerm, player.id, pageState.sort, isSearchActive]
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,7 +140,7 @@ export default function PlayerScores({ initialScoreData, initialSearch, player,
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const newUrl = getUrl(pageState.page);
|
const newUrl = getUrl(pageState.page);
|
||||||
window.history.replaceState({ ...window.history.state, as: newUrl, url: newUrl }, "", newUrl);
|
window.history.replaceState({ ...window.history.state, as: newUrl, url: newUrl }, "", newUrl);
|
||||||
}, [pageState, debouncedSearchTerm, player.id, isSearchActive]);
|
}, [pageState, debouncedSearchTerm, player.id, isSearchActive, getUrl]);
|
||||||
|
|
||||||
/**k
|
/**k
|
||||||
* Handle scrolling to the top of the
|
* Handle scrolling to the top of the
|
||||||
|
Reference in New Issue
Block a user