dify/web/app/components/billing/partner-stack/cookie-recorder.tsx
yyh 66a545fc6d
refactor: centralize deployment edition in system features (#39454)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: GareArc <garethcxy@dify.ai>
2026-07-24 07:15:02 +00:00

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
}