mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
fix: not owner can not pay (#1772)
This commit is contained in:
@@ -11,23 +11,23 @@ import { useProviderContext } from '@/context/provider-context'
|
||||
|
||||
const Billing: FC = () => {
|
||||
const { t } = useTranslation()
|
||||
const { isCurrentWorkspaceManager } = useAppContext()
|
||||
const { isCurrentWorkspaceOwner } = useAppContext()
|
||||
const [billingUrl, setBillingUrl] = React.useState('')
|
||||
const { enableBilling } = useProviderContext()
|
||||
|
||||
useEffect(() => {
|
||||
if (!enableBilling && !isCurrentWorkspaceManager)
|
||||
if (!enableBilling || !isCurrentWorkspaceOwner)
|
||||
return
|
||||
(async () => {
|
||||
const { url } = await fetchBillingUrl()
|
||||
setBillingUrl(url)
|
||||
})()
|
||||
}, [isCurrentWorkspaceManager])
|
||||
}, [isCurrentWorkspaceOwner])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<PlanComp loc={'billing-page'} />
|
||||
{enableBilling && isCurrentWorkspaceManager && billingUrl && (
|
||||
{enableBilling && isCurrentWorkspaceOwner && billingUrl && (
|
||||
<a className='mt-5 flex px-6 justify-between h-12 items-center bg-gray-50 rounded-xl cursor-pointer' href={billingUrl} target='_blank'>
|
||||
<div className='flex items-center'>
|
||||
<ReceiptList className='w-4 h-4 text-gray-700' />
|
||||
|
||||
Reference in New Issue
Block a user