Fix comment sort change (#1556)
This commit is contained in:
parent
cf700c3627
commit
b854e32f5c
1 changed files with 6 additions and 2 deletions
|
@ -197,7 +197,9 @@ export default function CommentList(props: Props) {
|
||||||
setPage(page + 1);
|
setPage(page + 1);
|
||||||
setDebouncedUri(undefined);
|
setDebouncedUri(undefined);
|
||||||
}
|
}
|
||||||
}, [debouncedUri, page, uri]);
|
// only for comparing uri with debounced uri
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [debouncedUri, uri]);
|
||||||
|
|
||||||
// Force comments reset
|
// Force comments reset
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -217,7 +219,9 @@ export default function CommentList(props: Props) {
|
||||||
// so set the current page as the fetched page to start fetching new pages from there
|
// so set the current page as the fetched page to start fetching new pages from there
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (page < currentFetchedPage) setPage(currentFetchedPage > 0 ? currentFetchedPage : 1);
|
if (page < currentFetchedPage) setPage(currentFetchedPage > 0 ? currentFetchedPage : 1);
|
||||||
}, [currentFetchedPage, page, uri]);
|
// only on uri change
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [uri]);
|
||||||
|
|
||||||
// Fetch top-level comments
|
// Fetch top-level comments
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
Loading…
Reference in a new issue