mirror of
https://github.com/langgenius/dify.git
synced 2026-01-08 07:14:14 +00:00
fix: refresh license limits when invite member success
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user