fix(showLoading): Make showLoading more robust

This commit is contained in:
Stuart Taylor
2018-03-07 09:53:54 +00:00
parent cebf72701e
commit 9f7084f7b7
2 changed files with 7 additions and 7 deletions

View File

@ -72,7 +72,6 @@ export function fetchChallengesForBlockEpic(
block: blockName = 'basic-html-and-html5'
} = challengeSelector(state);
const lang = langSelector(state);
if (fetchAnotherBlock) {
const fullBlocks = fullBlocksSelector(state);
if (fullBlocks.includes(payload)) {

View File

@ -9,16 +9,17 @@ import { challengeUpdated } from './redux';
import CompletionModal from './Completion-Modal.jsx';
import AppChildContainer from '../../Child-Container.jsx';
import { OverlayLoader } from '../../helperComponents';
import { fullBlocksSelector } from '../../entities';
import { paramsSelector } from '../../Router/redux';
const mapStateToProps = createSelector(
challengeSelector,
challenge => {
const { description } = challenge;
return {
fullBlocksSelector,
paramsSelector,
(challenge, fullBlocks, { block }) => ({
challenge,
showLoading: !description || description.length === 0
};
}
showLoading: !fullBlocks.includes(block)
})
);
const mapDispatchToProps = { challengeUpdated };