Merge pull request #10042 from BerkeleyTrue/fix/reset-update-main

Fix(challenges): reset challenge should update main iframe
This commit is contained in:
Mrugesh Mohapatra
2016-08-02 21:50:37 +05:30
committed by GitHub

View File

@ -1,15 +1,22 @@
import { Observable } from 'rx';
import types from './types';
import { updateCurrentChallenge } from './actions';
import {
updateCurrentChallenge,
updateMain
} from './actions';
export default function resetChallengeSaga(actions$, getState) {
return actions$
.filter(({ type }) => type === types.resetChallenge)
.map(() => {
.flatMap(() => {
const {
challengesApp: { challenge: dashedName },
entities: { challenge: challengeMap }
} = getState();
const currentChallenge = challengeMap[dashedName];
return updateCurrentChallenge(currentChallenge);
return Observable.of(
updateCurrentChallenge(currentChallenge),
updateMain()
);
});
}