mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
Fix search input
This commit is contained in:
@@ -18,16 +18,16 @@ const Result = require('../models/Result');
|
||||
* @return {Action}
|
||||
*/
|
||||
function query(q) {
|
||||
return (dispatch, getState, { Navigation }) => {
|
||||
return (dispatch, getState, { History }) => {
|
||||
const searchState = getState().search;
|
||||
const currentQuery = searchState.query;
|
||||
|
||||
const queryString = q ? { q } : {};
|
||||
|
||||
if (currentQuery && q) {
|
||||
dispatch(Navigation.replace({ query: queryString }));
|
||||
dispatch(History.replace({ query: queryString }));
|
||||
} else {
|
||||
dispatch(Navigation.push({ query: queryString }));
|
||||
dispatch(History.push({ query: queryString }));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user