Skip to content

Commit

Permalink
fix ParamPluginRuleHandle.js (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
SaberSola authored Oct 25, 2021
1 parent 26f4048 commit 88b0058
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/routes/Plugin/PluginRuleHandle/ParamPluginRuleHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ class ParamPluginRuleConfig extends Component {
};

onChangeConfig = (value, id) => {
const state = state;
const {activeKey} = state;
const state = this.state;
const { activeKey } = state;
const index = state[activeKey].findIndex(v => v.id === id);
const newData = state[activeKey].map(v => {
if (v.id === id) {
Expand All @@ -157,14 +157,14 @@ class ParamPluginRuleConfig extends Component {
}
return v;
});
this.setState({
this.setState(prevState =>({
[activeKey]:
value.type &&
state[activeKey][index].type === undefined &&
prevState[activeKey][index].type === undefined &&
activeKey === "body"
? newData.concat([{id: (+new Date()).toString()}])
: newData
});
}))
};

renderConfig = data => {
Expand Down

0 comments on commit 88b0058

Please sign in to comment.