refresh plugin list after installation

This commit is contained in:
Sebastian Sdorra
2019-08-21 15:07:56 +02:00
parent 05967aca4a
commit 707d3d2fd7
5 changed files with 35 additions and 25 deletions

View File

@@ -17,7 +17,7 @@ import classNames from "classnames";
type Props = {
plugin: Plugin,
onSubmit: () => void,
refresh: () => void,
onClose: () => void,
// context props
@@ -55,7 +55,7 @@ class PluginModal extends React.Component<Props, State> {
onInstallSuccess = () => {
const { restart } = this.state;
const { onClose } = this.props;
const { refresh, onClose } = this.props;
const newState = {
loading: false,
@@ -68,7 +68,10 @@ class PluginModal extends React.Component<Props, State> {
success: true
});
} else {
this.setState(newState, onClose);
this.setState(newState, () => {
refresh();
onClose();
});
}
};