File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import type {
33 LoaderFunctionArgs ,
44 MetaFunction ,
55} from "@remix-run/node" ;
6- import { json } from "@remix-run/node" ;
76import {
87 Links ,
98 Meta ,
@@ -70,7 +69,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
7069 let { locale = "de" } = params ;
7170 const cookieHeader = request . headers . get ( "Cookie" ) ;
7271 const cookie = ( await gdprConsent . parse ( cookieHeader ) ) || { } ;
73- return json ( { locale, track : cookie . gdprConsent } ) ;
72+ return { locale, track : cookie . gdprConsent } ;
7473}
7574
7675export function useChangeLanguage ( locale : string ) {
@@ -86,13 +85,11 @@ export default function App() {
8685
8786 useEffect ( ( ) => {
8887 setShouldTrack ( track ) ;
89- } , [ ] ) ;
88+ } , [ track ] ) ;
9089
91- useEffect ( ( ) => {
92- if ( shouldTrack ) {
93- gtag . init ( ) ;
94- }
95- } , [ shouldTrack ] ) ;
90+ if ( shouldTrack ) {
91+ gtag . init ( ) ;
92+ }
9693
9794 useChangeLanguage ( locale ) ;
9895
You can’t perform that action at this time.
0 commit comments