fix clear search (#2325)

This commit is contained in:
Wadim Kalmykov 2020-09-30 03:55:26 +07:00 committed by GitHub
parent 077eaaa2f9
commit 4b2d20cd85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,9 +2,8 @@ import setRouteWithForcedRefresh from '../../common/utils/setRouteWithForcedRefr
import SearchState from './SearchState';
export default class GlobalSearchState extends SearchState {
constructor(cachedSearches = [], searchRoute = 'index') {
constructor(cachedSearches = []) {
super(cachedSearches);
this.searchRoute = searchRoute;
}
getValue() {
@ -91,6 +90,6 @@ export default class GlobalSearchState extends SearchState {
const params = this.params();
delete params.q;
setRouteWithForcedRefresh(app.route(this.searchRoute, params));
setRouteWithForcedRefresh(app.route(app.current.get('routeName'), params));
}
}