Fix(lang): update challenge lang on user lang change

This commit is contained in:
Berkeley Martinez
2016-08-12 17:19:34 -07:00
parent 8addca59de
commit 043832302e
2 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,7 @@ export default function fetchChallengesSaga(action$, getState, { services }) {
))
.flatMap(({ type, payload: { dashedName, block } = {} }) => {
const state = getState();
const lang = state.app.languageTag;
const lang = state.app.lang;
if (type === replaceChallenge) {
const { challenge: newChallenge } = challengeSelector({
...state,
@ -46,6 +46,7 @@ export default function fetchChallengesSaga(action$, getState, { services }) {
options.params.block = block;
}
return services.readService$(options)
.retry(3)
.flatMap(({ entities, result, redirect } = {}) => {
if (type === fetchChallenge) {
return Observable.of(

View File

@ -49,7 +49,7 @@ export default function reactSubRouter(app) {
createApp({
serviceOptions,
location: req.originalUrl,
initialState: { app: { languageTag: lang } }
initialState: { app: { lang } }
})
// if react-router does not find a route send down the chain
.filter(({ redirect, props }) => {