From 06b0424b8247d7d52a01d2997dda5a5b20978fc0 Mon Sep 17 00:00:00 2001 From: keyan Date: Mon, 25 Oct 2021 14:49:46 -0500 Subject: [PATCH] mess with cache etc --- next.config.js | 3 +++ pages/top/[[...within]].js | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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