Skip to content

Commit

Permalink
fixbug/plugin-status (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
li-keguo authored Aug 4, 2023
1 parent a2b9e06 commit 879e4f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/routes/Plugin/Common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ export default class Common extends Component {
togglePluginStatus = () => {
const { dispatch, plugins } = this.props;
const pluginName = this.props.match.params ? this.props.match.params.id : "";
const { name, id, role, config, sort, file} = this.getPlugin(plugins, pluginName);
const plugin = this.getPlugin(plugins, pluginName)
const { name, id, role, config, sort, file} = plugin;
const enabled = !this.state.isPluginEnabled
const enabledStr = enabled ? '1' : '0';
dispatch({
Expand All @@ -273,6 +274,7 @@ export default class Common extends Component {
enabled: enabledStr
},
callback: () => {
plugin.enabled = enabled;
this.setState({ isPluginEnabled: enabled })
this.closeModal();
}
Expand Down

0 comments on commit 879e4f6

Please sign in to comment.