Skip to content

Commit

Permalink
fix(@dpc-sdp/nuxt-ripple): fixed console error when request event was…
Browse files Browse the repository at this point in the history
… being fetched client side

nuxt doesn't expose the useRequestEvent on the client, only the server so it was failing
  • Loading branch information
jeffdowdle committed Oct 6, 2023
1 parent 6676376 commit b8f9431
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/nuxt-ripple/composables/use-merge-section-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ const mergeTags = (existingTags: string, newTags: string): string => {
export const useMergeSectionTags = async (
sectionCacheTags: any
): Promise<void> => {
// event will be undefined if the request is on the client side
const event = useRequestEvent()

// Section.io cache tags must be set on the response header to invalidate the cache after a change in drupal
if (sectionCacheTags) {
if (event && sectionCacheTags) {
const currentResponseHeaders = getResponseHeaders(event)

const currentSectionTags: string =
Expand Down

0 comments on commit b8f9431

Please sign in to comment.