fix(showLoading): Make showLoading more robust
This commit is contained in:
@ -72,7 +72,6 @@ export function fetchChallengesForBlockEpic(
|
|||||||
block: blockName = 'basic-html-and-html5'
|
block: blockName = 'basic-html-and-html5'
|
||||||
} = challengeSelector(state);
|
} = challengeSelector(state);
|
||||||
const lang = langSelector(state);
|
const lang = langSelector(state);
|
||||||
|
|
||||||
if (fetchAnotherBlock) {
|
if (fetchAnotherBlock) {
|
||||||
const fullBlocks = fullBlocksSelector(state);
|
const fullBlocks = fullBlocksSelector(state);
|
||||||
if (fullBlocks.includes(payload)) {
|
if (fullBlocks.includes(payload)) {
|
||||||
|
@ -9,16 +9,17 @@ import { challengeUpdated } from './redux';
|
|||||||
import CompletionModal from './Completion-Modal.jsx';
|
import CompletionModal from './Completion-Modal.jsx';
|
||||||
import AppChildContainer from '../../Child-Container.jsx';
|
import AppChildContainer from '../../Child-Container.jsx';
|
||||||
import { OverlayLoader } from '../../helperComponents';
|
import { OverlayLoader } from '../../helperComponents';
|
||||||
|
import { fullBlocksSelector } from '../../entities';
|
||||||
|
import { paramsSelector } from '../../Router/redux';
|
||||||
|
|
||||||
const mapStateToProps = createSelector(
|
const mapStateToProps = createSelector(
|
||||||
challengeSelector,
|
challengeSelector,
|
||||||
challenge => {
|
fullBlocksSelector,
|
||||||
const { description } = challenge;
|
paramsSelector,
|
||||||
return {
|
(challenge, fullBlocks, { block }) => ({
|
||||||
challenge,
|
challenge,
|
||||||
showLoading: !description || description.length === 0
|
showLoading: !fullBlocks.includes(block)
|
||||||
};
|
})
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const mapDispatchToProps = { challengeUpdated };
|
const mapDispatchToProps = { challengeUpdated };
|
||||||
|
Reference in New Issue
Block a user