mirror of
https://github.com/barthuijgen/factorio-sites.git
synced 2025-03-04 15:51:24 +02:00
fix: prevent pagination redirect for same url
This commit is contained in:
parent
bc86109e8a
commit
6984d97adf
@ -19,6 +19,10 @@ export const Pagination: React.FC<BoxProps & PaginationProps> = ({
|
||||
const router = useRouter();
|
||||
|
||||
const handlePageChange = ({ selected }: { selected: number }) => {
|
||||
if ((router.query.page || "1") === String(selected + 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const query: Record<string, string> = { ...router.query, page: String(selected + 1) };
|
||||
const href = `/?${Object.keys(query)
|
||||
.map((key) => `${key}=${query[key]}`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user