Skip to content

Commit

Permalink
fix(plugin): set disable but useless
Browse files Browse the repository at this point in the history
  • Loading branch information
juzhiyuan committed Dec 12, 2020
1 parent 67f16c3 commit 020c327
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web/src/components/Plugin/PluginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const PluginPage: React.FC<Props> = ({
const { valid, errors } = validate(value, schema);
if (valid) {
setName(NEVER_EXIST_PLUGIN_FLAG);
onChange({ ...initialData, [pluginName]: { ...value, disable: false } });
onChange({ ...initialData, [pluginName]: value });
return;
}
errors?.forEach((item) => {
Expand Down Expand Up @@ -146,7 +146,10 @@ const PluginPage: React.FC<Props> = ({
disabled={readonly}
onChange={(isChecked) => {
if (isChecked) {
validateData(item.name, initialData[item.name]);
validateData(item.name, {
...initialData[item.name],
disable: false
});
} else {
onChange({
...initialData,
Expand Down

0 comments on commit 020c327

Please sign in to comment.