mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
fix(consent-state): add IS_PLATFORM check in initUserCentrics() (#35805)
- The check on IS_PLATFORM should skip the usercentrics initialization in self-hosted environment and prevent the dashboard errors
This commit is contained in:
1 parent
854f6d960d
commit
fa2c766aea
1 file changed
+2
-1
@@ -1,7 +1,7 @@
|
||||
import type Usercentrics from '@usercentrics/cmp-browser-sdk'
|
||||
import type { BaseCategory, UserDecision } from '@usercentrics/cmp-browser-sdk'
|
||||
import { proxy, snapshot, useSnapshot } from 'valtio'
|
||||
import { LOCAL_STORAGE_KEYS } from './constants'
|
||||
import { LOCAL_STORAGE_KEYS, IS_PLATFORM } from './constants'
|
||||
|
||||
export const consentState = proxy({
|
||||
// Usercentrics state
|
||||
@@ -60,6 +60,7 @@ export const consentState = proxy({
|
||||
|
||||
async function initUserCentrics() {
|
||||
if (process.env.NODE_ENV === 'test') return
|
||||
if (!IS_PLATFORM) return
|
||||
|
||||
const { default: Usercentrics } = await import('@usercentrics/cmp-browser-sdk')
|
||||
|
||||
|
||||
Reference in new issue
Block a user