mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: AI config null check
This commit is contained in:
parent
077c26ce15
commit
af7d5edd80
1 changed files with 7 additions and 1 deletions
|
|
@ -11,7 +11,13 @@ function useGetAIFeatures(props: UseGetAIFeatures) {
|
|||
const [isEnabled, setisEnabled] = React.useState(false)
|
||||
|
||||
function checkAvailableAIFeaturesOnOrg(feature: string) {
|
||||
const config = org.config.config.AIConfig;
|
||||
const config = org?.config?.config?.AIConfig;
|
||||
|
||||
if (!config) {
|
||||
console.log("AI or Organization config is not defined.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!config.enabled) {
|
||||
console.log("AI is not enabled for this Organization.");
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue