Skip to content

Commit

Permalink
Fix preview (#320)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Cosgrove <timcosgrove@users.noreply.github.com>
  • Loading branch information
tjheffner and timcosgrove authored Jan 3, 2024
1 parent 07f306f commit 17a5ce0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/lib/drupal/query.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -103,8 +102,8 @@ export async function getMenu(name: string, params?: QueryParams<null>) {
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}`,
})

Expand Down
2 changes: 1 addition & 1 deletion src/templates/layouts/event/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 17a5ce0

Please sign in to comment.