Fix(challenges): reset challenge should update main iframe
This commit is contained in:
@ -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()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user