mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Use replace instead of push for host table changes (#1936)
This commit is contained in:
parent
a099854045
commit
2458209a6c
1 changed files with 6 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue