diff --git a/src/lib/drupal/query.ts b/src/lib/drupal/query.ts index 0d4bd68e1..0ad9dfbb2 100644 --- a/src/lib/drupal/query.ts +++ b/src/lib/drupal/query.ts @@ -1,5 +1,4 @@ import { DrupalJsonApiParams } from 'drupal-jsonapi-params' -import { PHASE_PRODUCTION_BUILD } from 'next/constants' import { JsonApiResponse } from 'next-drupal' import { QueryParams } from 'next-drupal-query' import { queries } from '@/data/queries' @@ -103,8 +102,8 @@ export async function getMenu(name: string, params?: QueryParams) { const menu = await drupalClient.getMenu(name, { params: params ? params().getQueryObject() : defaultMenuParams, - // Cache resource during build, not dev. - withCache: process.env.NEXT_PHASE === PHASE_PRODUCTION_BUILD, + // Cache resource if redis is available + withCache: process.env.USE_REDIS === 'true', cacheKey: `menu:${name}`, }) diff --git a/src/templates/layouts/event/index.tsx b/src/templates/layouts/event/index.tsx index 69f267843..7ade6b24d 100644 --- a/src/templates/layouts/event/index.tsx +++ b/src/templates/layouts/event/index.tsx @@ -46,7 +46,7 @@ export const Event = ({ // Calculate the most recent date when the component mounts const recentDate = deriveMostRecentDate(formattedDates) setMostRecentDate(recentDate) - }, [datetimeRange]) + }, [formattedDates]) const toggleRecurringEvents = () => { setShowRecurringEvents((prevState) => !prevState)