diff --git a/src/app/area/[[...slug]]/page.tsx b/src/app/area/[[...slug]]/page.tsx index 56b7eef8d..fe399d386 100644 --- a/src/app/area/[[...slug]]/page.tsx +++ b/src/app/area/[[...slug]]/page.tsx @@ -169,7 +169,7 @@ const EditDescriptionCTA: React.FC<{ uuid: string }> = ({ uuid }) => ( * List of area pages to prebuild */ export function generateStaticParams (): PageSlugType[] { - return [ + const list = [ { slug: ['bea6bf11-de53-5046-a5b4-b89217b7e9bc'] }, // Red Rock { slug: ['78da26bc-cd94-5ac8-8e1c-815f7f30a28b'] }, // Red River Gorge { slug: ['1db1e8ba-a40e-587c-88a4-64f5ea814b8e'] }, // USA @@ -180,6 +180,10 @@ export function generateStaticParams (): PageSlugType[] { { slug: ['b1166235-3328-5537-b5ed-92f406ea8495'] }, // Lander { slug: ['9abad566-2113-587e-95a5-b3abcfaa28ac'] } // Ten Sleep ] + if (process.env.VERCEL_ENV !== 'production') { + return list.slice(0, 1) + } + return list } // Page metadata diff --git a/src/app/page.tsx b/src/app/page.tsx index ff6d67068..81ec9751a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -12,8 +12,7 @@ import { RecentContributionsMap } from './components/recent/RecentContributionsM /** * Cache duration in seconds */ -export const revalidate = 300 -export const fetchCache = 'force-no-store' // opt out of Nextjs version of 'fetch' +export const revalidate = 3600 /** * Root home page diff --git a/src/components/edit/DefaultView.tsx b/src/components/edit/DefaultView.tsx deleted file mode 100644 index 95aeda68b..000000000 --- a/src/components/edit/DefaultView.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { LinkButton } from '../ui/Button' - -export default function DefaultView (): JSX.Element { - return ( -
-
Quick edit
-
- - Add New Area - -
Area: a crag, boulder, or a well-known destination
-
-
- -
Climb: a route climb or a boulder problem (coming soon)
-
-
- ) -} diff --git a/src/js/graphql/contribAPI.ts b/src/js/graphql/contribAPI.ts index 023770f89..c55c91225 100644 --- a/src/js/graphql/contribAPI.ts +++ b/src/js/graphql/contribAPI.ts @@ -6,11 +6,11 @@ export const getChangeHistoryServerSide = async (): Promise => try { const rs = await graphqlClient.query<{ getChangeHistory: ChangesetType[] }>({ query: QUERY_RECENT_CHANGE_HISTORY, - fetchPolicy: 'no-cache' + fetchPolicy: 'cache-first' }) if (Array.isArray(rs.data?.getChangeHistory)) { - return rs.data?.getChangeHistory.splice(0, 50) + return rs.data?.getChangeHistory.slice(0, 50) } console.log('WARNING: getChangeHistory() returns non-array data') return [] diff --git a/src/js/graphql/gql/contribs.ts b/src/js/graphql/gql/contribs.ts index 6af017055..0e132a437 100644 --- a/src/js/graphql/gql/contribs.ts +++ b/src/js/graphql/gql/contribs.ts @@ -162,6 +162,7 @@ export const FRAGMENT_CHANGE_HISTORY = gql` length } ... on Organization { + orgId displayName } } diff --git a/src/pages/edit/index.tsx b/src/pages/edit/index.tsx index 05cf3f9af..500b9fcd9 100644 --- a/src/pages/edit/index.tsx +++ b/src/pages/edit/index.tsx @@ -5,7 +5,7 @@ import SeoTags from '../../components/SeoTags' import Layout from '../../components/layout' import { getChangeHistoryServerSide } from '../../js/graphql/contribAPI' import { RecentChangeHistoryProps } from '../../components/edit/RecentChangeHistory' -import DefaultView from '../../components/edit/DefaultView' + interface PageProps { history: any[] } @@ -22,7 +22,6 @@ const Page: NextPage = ({ history }: PageProps) => { showFooter >
-

Recent history

@@ -38,7 +37,7 @@ export const getStaticProps: GetStaticProps = async ({ params }): Pro props: { history }, - revalidate: 5 // regenerate page when a request comes in but no faster than every 5s + revalidate: 30 // regenerate page when a request comes in but no faster than every 5s }) }