Skip to content

Commit

Permalink
Merge pull request #778 from DTS-STN/aa-error-page
Browse files Browse the repository at this point in the history
Fix beforeInteractive lint warning
  • Loading branch information
Charles-Pham authored Dec 5, 2024
2 parents e83e1f5 + f04932b commit 4586a6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
16 changes: 0 additions & 16 deletions components/MetaData.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Head from 'next/head'
import Script from 'next/script'

interface Content {
title: string
Expand Down Expand Up @@ -60,21 +59,6 @@ const MetaData = ({ language, data }: MetaDataProps) => {
<meta name="dcterms.accessRights" content={d.accessRights} />
<meta name="dcterms.service" content={d.service} />
</Head>

{
// AA script must be loaded before the pageLoad event fires
process.env.ENVIRONMENT === 'production' ? (
<Script
strategy="beforeInteractive"
src="//assets.adobedtm.com/be5dfd287373/9b9cb7867b5b/launch-59d77766b86a.min.js"
/>
) : (
<Script
strategy="beforeInteractive"
src="https://assets.adobedtm.com/be5dfd287373/9b9cb7867b5b/launch-cad75bf2f0d2-staging.min.js"
/>
)
}
</>
)
}
Expand Down
15 changes: 15 additions & 0 deletions pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Html, Head, Main, NextScript } from 'next/document'
import Script from 'next/script'

export default function Document() {
return (
Expand All @@ -9,6 +10,20 @@ export default function Document() {
<script>0</script>
<Main />
<NextScript />
{
// AA script must be loaded before the pageLoad event fires
process.env.ENVIRONMENT === 'production' ? (
<Script
strategy="beforeInteractive"
src="//assets.adobedtm.com/be5dfd287373/9b9cb7867b5b/launch-59d77766b86a.min.js"
/>
) : (
<Script
strategy="beforeInteractive"
src="https://assets.adobedtm.com/be5dfd287373/9b9cb7867b5b/launch-cad75bf2f0d2-staging.min.js"
/>
)
}
</body>
</Html>
)
Expand Down

0 comments on commit 4586a6c

Please sign in to comment.