Skip to content

Commit

Permalink
add insufficient blocks case
Browse files Browse the repository at this point in the history
  • Loading branch information
kimprice committed Aug 21, 2023
1 parent bd79496 commit 6745a50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webapp/src/components/tutorialValidators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class BlocksExistValidator extends CodeValidatorBase {
const {
missingBlocks,
disabledBlocks,
insufficientBlocks
} = pxt.blocks.validateBlocksExist({
usedBlocks: editor.getAllBlocks(false /* ordered */),
requiredBlockCounts: stepHighlights,
Expand All @@ -81,6 +82,9 @@ export class BlocksExistValidator extends CodeValidatorBase {
} else if (disabledBlocks.length > 0) {
isValid = false;
errorDescription = lf("Make sure your blocks are connected to the rest of your code like this.");
} else if (insufficientBlocks.length > 0) {
isValid = false;
errorDescription = lf("Make sure you have enough blocks in your workspace. It should look like this.");
}

const blockImages = stepInfo?.hintContentMd ? (<div>
Expand Down

0 comments on commit 6745a50

Please sign in to comment.