Merged in fix/pageview-tracking (pull request #1687)
Fix/pageview tracking * Restructure pageview tracking * Update trpc version and turn off batching * Remove unused state and remove logs * cleanup * remove unused code and console.logs Approved-by: Linus Flood
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
"use client"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import RouterTransition from "@/components/TrackingSDK/RouterTransition"
|
||||
import {
|
||||
useTrackHardNavigation,
|
||||
useTrackSoftNavigation,
|
||||
} from "@/components/TrackingSDK/hooks"
|
||||
|
||||
import type {
|
||||
TrackingSDKHotelInfo,
|
||||
@@ -19,19 +20,8 @@ export default function TrackingSDK({
|
||||
hotelInfo?: TrackingSDKHotelInfo
|
||||
paymentInfo?: TrackingSDKPaymentInfo
|
||||
}) {
|
||||
const { data: userTrackingData, isPending } =
|
||||
trpc.user.userTrackingInfo.useQuery()
|
||||
useTrackHardNavigation({ pageData, hotelInfo, paymentInfo })
|
||||
useTrackSoftNavigation({ pageData, hotelInfo, paymentInfo })
|
||||
|
||||
if (isPending || !userTrackingData) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<RouterTransition
|
||||
pageData={pageData}
|
||||
userData={userTrackingData}
|
||||
hotelInfo={hotelInfo}
|
||||
paymentInfo={paymentInfo}
|
||||
/>
|
||||
)
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user