Fix back button going to the home/search page

This commit is contained in:
Jordan Eldredge 2018-12-08 15:46:39 -08:00
parent e51a59f7aa
commit b5091c855e
2 changed files with 5 additions and 6 deletions

View file

@ -1,5 +1,5 @@
import { combineEpics } from "redux-observable";
import { of, from, empty } from "rxjs";
import { of, from } from "rxjs";
import * as Actions from "./actionCreators";
import * as Selectors from "./selectors";
import { filter, switchMap, map } from "rxjs/operators";
@ -16,10 +16,7 @@ const urlChangedEpic = actions =>
const segments = action.location.pathname.split("/");
return of(Actions.selectedSkin(segments[2]));
}
if (query == null) {
return empty();
}
return of(Actions.searchQueryChanged(query));
return of(Actions.searchQueryChanged(query || ""));
})
);

View file

@ -27,7 +27,9 @@ function reducer(state = defaultState, action) {
case "SEARCH_QUERY_CHANGED":
return {
...state,
searchQuery: action.query
searchQuery: action.query,
selectedSkinHash: null,
selectedSkinPosition: null
};
case "GOT_NEW_MATCHING_HASHES":
return {