Use replace instead of push for host table changes (#1936)

This commit is contained in:
gillespi314 2021-09-08 13:59:50 -05:00 committed by GitHub
parent a099854045
commit 2458209a6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import { push, goBack } from "react-router-redux";
import { goBack, push, replace } from "react-router-redux";
import { find, isEmpty, memoize, omit } from "lodash";
import Button from "components/buttons/Button";
@ -381,7 +381,7 @@ export class ManageHostsPage extends PureComponent {
}
dispatch(
push(
replace(
getNextLocationPath({
pathPrefix: PATHS.MANAGE_HOSTS,
routeTemplate,
@ -635,7 +635,6 @@ export class ManageHostsPage extends PureComponent {
};
retrieveHosts = async (options = {}) => {
const { dispatch } = this.props;
const { getValidatedTeamId } = this;
this.setState({ isHostsLoading: true });
@ -727,7 +726,7 @@ export class ManageHostsPage extends PureComponent {
});
dispatch(
push(
replace(
getNextLocationPath({
pathPrefix: PATHS.MANAGE_HOSTS,
routeTemplate,
@ -760,7 +759,7 @@ export class ManageHostsPage extends PureComponent {
teamId: selectedTeam,
});
dispatch(
push(
replace(
getNextLocationPath({
pathPrefix: PATHS.MANAGE_HOSTS,
routeTemplate,
@ -806,7 +805,7 @@ export class ManageHostsPage extends PureComponent {
? omit(queryParams, "team_id")
: Object.assign({}, queryParams, { team_id: teamIdParam }),
});
dispatch(push(nextLocation));
dispatch(replace(nextLocation));
};
handleLabelChange = ({ slug }) => {
@ -843,7 +842,7 @@ export class ManageHostsPage extends PureComponent {
}
dispatch(
push(
replace(
getNextLocationPath({
pathPrefix: isAllHosts
? MANAGE_HOSTS