mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-07 11:00:28 +08:00
feat: prevent two captcha providers are added to one single application (#4025)
This commit is contained in:
@@ -88,7 +88,10 @@ class ProviderTable extends React.Component {
|
|||||||
}
|
}
|
||||||
}} >
|
}} >
|
||||||
{
|
{
|
||||||
Setting.getDeduplicatedArray(this.props.providers, table, "name").map((provider, index) => <Option key={index} value={provider.name}>{provider.name}</Option>)
|
Setting.getDeduplicatedArray(this.props.providers, table, "name").filter(provider => provider.category !== "Captcha" || !table.some(tableItem => {
|
||||||
|
const existingProvider = Setting.getArrayItem(this.props.providers, "name", tableItem.name);
|
||||||
|
return existingProvider && existingProvider.category === "Captcha";
|
||||||
|
})).map((provider, index) => <Option key={index} value={provider.name}>{provider.name}</Option>)
|
||||||
}
|
}
|
||||||
</Select>
|
</Select>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user