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

View File

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