mirror of
https://github.com/langgenius/dify.git
synced 2026-01-26 21:52:20 +08:00
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
21 lines
608 B
TypeScript
21 lines
608 B
TypeScript
'use client'
|
|
import { IS_CLOUD_EDITION } from '@/config'
|
|
import type { FC } from 'react'
|
|
import React, { useEffect } from 'react'
|
|
import usePSInfo from './use-ps-info'
|
|
|
|
const PartnerStack: FC = () => {
|
|
const { 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()
|
|
}, [])
|
|
|
|
return null
|
|
}
|
|
export default React.memo(PartnerStack)
|