mirror of https://github.com/langgenius/dify.git
fix: refresh license limits when invite member success
This commit is contained in:
parent
8de24736ac
commit
51001544e4
|
|
@ -32,6 +32,7 @@ const InviteModal = ({
|
|||
}: IInviteModalProps) => {
|
||||
const { t } = useTranslation()
|
||||
const licenseLimit = useProviderContextSelector(s => s.licenseLimit)
|
||||
const refreshLicenseLimit = useProviderContextSelector(s => s.refreshLicenseLimit)
|
||||
const [emails, setEmails] = useState<string[]>([])
|
||||
const { notify } = useContext(ToastContext)
|
||||
const [isLimited, setIsLimited] = useState(false)
|
||||
|
|
@ -59,6 +60,7 @@ const InviteModal = ({
|
|||
})
|
||||
|
||||
if (result === 'success') {
|
||||
refreshLicenseLimit()
|
||||
onCancel()
|
||||
onSend(invitation_results)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ type ProviderContextState = {
|
|||
size: number
|
||||
limit: number
|
||||
}
|
||||
}
|
||||
},
|
||||
refreshLicenseLimit: () => void
|
||||
}
|
||||
const ProviderContext = createContext<ProviderContextState>({
|
||||
modelProviders: [],
|
||||
|
|
@ -95,6 +96,7 @@ const ProviderContext = createContext<ProviderContextState>({
|
|||
limit: 0,
|
||||
},
|
||||
},
|
||||
refreshLicenseLimit: noop,
|
||||
})
|
||||
|
||||
export const useProviderContext = () => useContext(ProviderContext)
|
||||
|
|
@ -223,6 +225,7 @@ export const ProviderContextProvider = ({
|
|||
isEducationAccount: isEducationAccount?.result || false,
|
||||
webappCopyrightEnabled,
|
||||
licenseLimit,
|
||||
refreshLicenseLimit: fetchPlan,
|
||||
}}>
|
||||
{children}
|
||||
</ProviderContext.Provider>
|
||||
|
|
|
|||
Loading…
Reference in New Issue