From b5091c855ed6f12ffbbd084829e2de4f322f0dfc Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sat, 8 Dec 2018 15:46:39 -0800 Subject: [PATCH] Fix back button going to the home/search page --- src/redux/epics.js | 7 ++----- src/redux/store.js | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/redux/epics.js b/src/redux/epics.js index 8b539acf..694b90f0 100644 --- a/src/redux/epics.js +++ b/src/redux/epics.js @@ -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 || "")); }) ); diff --git a/src/redux/store.js b/src/redux/store.js index 8837e159..00a54bcb 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -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 {