mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
Co-authored-by: jyong <718720800@qq.com> Co-authored-by: Yansong Zhang <916125788@qq.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: hj24 <mambahj24@gmail.com> Co-authored-by: hj24 <huangjian@dify.ai> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Co-authored-by: CodingOnStar <hanxujiang@dify.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
22 lines
700 B
TypeScript
22 lines
700 B
TypeScript
'use client'
|
|
import type { FC } from 'react'
|
|
import * as React from 'react'
|
|
import { useEffect } from 'react'
|
|
import { IS_CLOUD_EDITION } from '@/config'
|
|
import usePSInfo from './use-ps-info'
|
|
|
|
const PartnerStack: FC = () => {
|
|
const { psPartnerKey, psClickId, saveOrUpdate, bind } = usePSInfo()
|
|
useEffect(() => {
|
|
if (!IS_CLOUD_EDITION)
|
|
return
|
|
// Save PartnerStack info in cookie first. Because if user hasn't logged in, redirecting to login page would cause lose the partnerStack info in URL.
|
|
saveOrUpdate()
|
|
// bind PartnerStack info after user logged in
|
|
bind()
|
|
}, [psPartnerKey, psClickId, saveOrUpdate, bind])
|
|
|
|
return null
|
|
}
|
|
export default React.memo(PartnerStack)
|