From 2458209a6cc792cc189c43cb8da3f5c4095dc442 Mon Sep 17 00:00:00 2001 From: gillespi314 <73313222+gillespi314@users.noreply.github.com> Date: Wed, 8 Sep 2021 13:59:50 -0500 Subject: [PATCH] Use replace instead of push for host table changes (#1936) --- .../pages/hosts/ManageHostsPage/ManageHostsPage.jsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.jsx b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.jsx index d1e8eb4655..8e92daa5d4 100644 --- a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.jsx +++ b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.jsx @@ -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