diff --git a/next.config.js b/next.config.js index fd3e7880..8181d6b2 100644 --- a/next.config.js +++ b/next.config.js @@ -2,6 +2,9 @@ const { withPlausibleProxy } = require('next-plausible') module.exports = withPlausibleProxy()({ compress: false, + experimental: { + scrollRestoration: true + }, generateBuildId: process.env.NODE_ENV === 'development' ? undefined : async () => { diff --git a/pages/top/[[...within]].js b/pages/top/[[...within]].js index 354ed3a0..b599ec43 100644 --- a/pages/top/[[...within]].js +++ b/pages/top/[[...within]].js @@ -7,11 +7,12 @@ import { Nav, Navbar } from 'react-bootstrap' import styles from '../../components/header.module.css' import Link from 'next/link' -export async function getServerSideProps ({ req }) { +export async function getServerSideProps ({ req, params: { within } }) { const client = await getSSRApolloClient(req) + console.log('called') const { data } = await client.query({ query: MORE_ITEMS, - variables: { sort: 'top', within: req.query?.within?.pop() } + variables: { sort: 'top', within: within?.pop() } }) let items, cursor