The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix(docs): accepting consent (#32594)
Alaister Young91a36c9dcf53
diff --git a/packages/common/hooks/useTelemetryProps.ts b/packages/common/hooks/useTelemetryProps.tsindex 88a16ef8b8f..d70b3d76ac0 100644--- a/packages/common/hooks/useTelemetryProps.ts+++ b/packages/common/hooks/useTelemetryProps.ts@@ -1,11 +1,13 @@'use client'import { useRouter } from 'next/compat/router'+import { usePathname } from 'next/navigation'import { isBrowser } from '../helpers'export interface TelemetryProps {screenResolution?: stringpage_url: string+ pathname: stringsearch: stringlanguage: stringviewport_height: number@@ -14,11 +16,13 @@ export interface TelemetryProps {export function useTelemetryProps(): TelemetryProps {const router = useRouter()+ const pathname = usePathname()const locale = router ? router.locale : undefinedreturn {screenResolution: isBrowser ? `${window.innerWidth}x${window.innerHeight}` : undefined,page_url: isBrowser ? window.location.href : '',+ pathname: router?.pathname ?? pathname ?? window.location.pathname,search: isBrowser ? window.location.search : '',viewport_height: isBrowser ? window.innerHeight : 0,viewport_width: isBrowser ? window.innerWidth : 0,diff --git a/packages/ui-patterns/ConsentToast/index.tsx b/packages/ui-patterns/ConsentToast/index.tsxindex 8f3d0376274..ecaf811ba15 100644--- a/packages/ui-patterns/ConsentToast/index.tsx+++ b/packages/ui-patterns/ConsentToast/index.tsx@@ -9,7 +9,6 @@ import {} from 'common'import { noop } from 'lodash'-import router from 'next/router'import { useCallback, useEffect, useRef, useState } from 'react'import { toast } from 'sonner'import { Button, cn } from 'ui'@@ -110,7 +109,7 @@ export const useConsent = () => {const telemetryData = {page_url: telemetryProps.page_url,page_title: typeof document !== 'undefined' ? document?.title : '',- pathname: router.pathname,+ pathname: telemetryProps.pathname,ph: {referrer: typeof document !== 'undefined' ? document?.referrer : '',language: telemetryProps.language,@@ -200,7 +199,7 @@ export const useConsentValue = (KEY_NAME: string) => {const telemetryData = {page_url: telemetryProps.page_url,page_title: typeof document !== 'undefined' ? document?.title : '',- pathname: router.pathname,+ pathname: telemetryProps.pathname,ph: {referrer: typeof document !== 'undefined' ? document?.referrer : '',language: telemetryProps.language,