avoid history spamming
This commit is contained in:
parent
905f34d04a
commit
70320b40a5
@ -3,7 +3,7 @@ import {debounce} from 'underscore'
|
||||
|
||||
import React from 'react'
|
||||
import {connect} from 'react-redux'
|
||||
import {push} from 'react-router-redux'
|
||||
import {replace} from 'react-router-redux'
|
||||
|
||||
import PageHeader from 'components/page-header'
|
||||
import Details from './details'
|
||||
@ -31,7 +31,7 @@ class RouteserversPage extends React.Component {
|
||||
this.props.dispatch(setFilterValue(value));
|
||||
|
||||
// Update location delayed
|
||||
this.dispatchDebounced(push(
|
||||
this.dispatchDebounced(replace(
|
||||
makeQueryLinkProps(
|
||||
this.props.routing,
|
||||
value,
|
||||
@ -39,13 +39,6 @@ class RouteserversPage extends React.Component {
|
||||
this.props.sortOrder)));
|
||||
}
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
// Reset Filters
|
||||
this.props.dispatch(setFilterValue(""));
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
return(
|
||||
<div className="routeservers-page">
|
||||
|
@ -110,7 +110,7 @@ class NeighborColumnHeader extends React.Component {
|
||||
// Render link with sorting indicator
|
||||
if (active) {
|
||||
const nextOrder = (this.props.order == 'asc') ? 'desc' : 'asc';
|
||||
const url = `${baseUrl}?s=${sortColumn}&o=${nextOrder}`;
|
||||
const url = `${baseUrl}?s=${sortColumn}&o=${nextOrder}&q=${this.props.query}`;
|
||||
let indicator = <i className="fa fa-arrow-circle-up"></i>;
|
||||
|
||||
cls += 'col-neighbor-active ';
|
||||
@ -126,7 +126,7 @@ class NeighborColumnHeader extends React.Component {
|
||||
}
|
||||
|
||||
// Column is not active, just present a link:
|
||||
const url = `${baseUrl}?s=${sortColumn}&o=${this.props.order}`
|
||||
const url = `${baseUrl}?s=${sortColumn}&o=${this.props.order}&q=${this.props.query}`
|
||||
return(
|
||||
<th className={cls}>
|
||||
<Link to={url}>{name}</Link>
|
||||
@ -243,7 +243,8 @@ class NeighboursTableView extends React.Component {
|
||||
rsId={this.props.routeserverId}
|
||||
columns={columns} column={col}
|
||||
sort={this.props.sortColumn}
|
||||
order={this.props.sortOrder} />
|
||||
order={this.props.sortOrder}
|
||||
query={this.props.filterQuery} />
|
||||
);
|
||||
});
|
||||
|
||||
@ -307,6 +308,7 @@ const NeighboursTable = connect(
|
||||
|
||||
sortColumn: state.neighbors.sortColumn,
|
||||
sortOrder: state.neighbors.sortOrder,
|
||||
filterQuery: state.neighbors.filterQuery,
|
||||
})
|
||||
)(NeighboursTableView);
|
||||
|
||||
|
@ -6,7 +6,7 @@ import React from 'react'
|
||||
import {connect} from 'react-redux'
|
||||
|
||||
import {Link} from 'react-router'
|
||||
import {push} from 'react-router-redux'
|
||||
import {push, replace} from 'react-router-redux'
|
||||
|
||||
import Details from '../details'
|
||||
import Status from '../status'
|
||||
@ -106,7 +106,7 @@ class RoutesPage extends React.Component {
|
||||
setFilterQueryValue(value)
|
||||
);
|
||||
|
||||
this.debouncedDispatch(push(makeQueryLinkProps(
|
||||
this.debouncedDispatch(replace(makeQueryLinkProps(
|
||||
this.props.routing, value, this.props.loadNotExported
|
||||
)));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user