mirror of
https://github.com/langgenius/dify.git
synced 2026-07-26 22:28:32 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: GareArc <garethcxy@dify.ai>
28 lines
656 B
TypeScript
28 lines
656 B
TypeScript
'use client'
|
|
|
|
import { useSuspenseQuery } from '@tanstack/react-query'
|
|
import { useEffect } from 'react'
|
|
import { systemFeaturesQueryOptions } from '@/features/system-features/client'
|
|
import usePSInfo from './use-ps-info'
|
|
|
|
export function PartnerStackCookieRecorder() {
|
|
const { data: deploymentEdition } = useSuspenseQuery({
|
|
...systemFeaturesQueryOptions(),
|
|
select: ({ deployment_edition }) => deployment_edition,
|
|
})
|
|
|
|
if (deploymentEdition !== 'CLOUD') return null
|
|
|
|
return <CookieRecorder />
|
|
}
|
|
|
|
function CookieRecorder() {
|
|
const { saveOrUpdate } = usePSInfo()
|
|
|
|
useEffect(() => {
|
|
saveOrUpdate()
|
|
}, [saveOrUpdate])
|
|
|
|
return null
|
|
}
|