Replace hard reload with refresh

This commit is contained in:
Rene Pfeuffer
2019-10-01 10:27:06 +02:00
parent 92af956c5e
commit e6d32a1468
3 changed files with 13 additions and 6 deletions

View File

@@ -19,6 +19,7 @@ type Props = {
actionType: string,
pendingPlugins?: PendingPlugins,
installedPlugins?: PluginCollection,
refresh: () => void,
// context props
t: string => string
@@ -99,7 +100,7 @@ class MultiPluginActionModal extends React.Component<Props, State> {
apiClient
.post(pendingPlugins._links.cancel.href)
.then(() => this.reload())
.then(() => this.refresh())
.catch(error => {
this.setState({
success: false,
@@ -117,18 +118,19 @@ class MultiPluginActionModal extends React.Component<Props, State> {
apiClient
.post(installedPlugins._links.update.href)
.then(() => this.reload());
.then(() => this.refresh());
};
reload = () => {
window.location.reload(true);
refresh = () => {
this.props.refresh();
this.props.onClose();
};
renderModalContent = () => {
const { actionType } = this.props;
if (actionType === MultiPluginActionType.UPDATE_ALL) {
return <>{this.renderUpdatable()}</>;
return this.renderUpdatable();
} else {
return (
<>