fix(showLoading): Make showLoading more robust
This commit is contained in:
@ -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)) {
|
||||
|
@ -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 };
|
||||
|
Reference in New Issue
Block a user