Moves to next challenges
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import { Observable } from 'rx';
|
||||
import types from '../../common/app/routes/challenges/redux/types';
|
||||
import { makeToast } from '../../common/app/redux/actions';
|
||||
|
||||
import { randomCompliment } from '../../common/app/utils/get-words';
|
||||
/*
|
||||
import {
|
||||
updateOutput,
|
||||
checkChallenge,
|
||||
updateTests
|
||||
} from '../../common/app/routes/challenges/redux/actions';
|
||||
*/
|
||||
|
||||
export default function completionSaga(actions$, getState) {
|
||||
return actions$
|
||||
.filter(({ type }) => (
|
||||
type === types.checkChallenge
|
||||
))
|
||||
.flatMap(() => {
|
||||
const { tests } = getState().challengesApp;
|
||||
if (tests.length > 1 && tests.every(test => test.pass && !test.err)) {
|
||||
return Observable.of(
|
||||
makeToast({
|
||||
type: 'success',
|
||||
message: randomCompliment()
|
||||
})
|
||||
);
|
||||
}
|
||||
return Observable.just(null);
|
||||
});
|
||||
}
|
@@ -5,7 +5,6 @@ import hardGoToSaga from './hard-go-to-saga';
|
||||
import windowSaga from './window-saga';
|
||||
import executeChallengeSaga from './execute-challenge-saga';
|
||||
import frameSaga from './frame-saga';
|
||||
import completionSaga from './completion-saga';
|
||||
import codeStorageSaga from './code-storage-saga';
|
||||
|
||||
export default [
|
||||
@@ -16,6 +15,5 @@ export default [
|
||||
windowSaga,
|
||||
executeChallengeSaga,
|
||||
frameSaga,
|
||||
completionSaga,
|
||||
codeStorageSaga
|
||||
];
|
||||
|
Reference in New Issue
Block a user