Skip to content

Commit

Permalink
Add warning when trying to carry over code without a template code bl…
Browse files Browse the repository at this point in the history
…ock (#10020)

* Add warning when trying to carry over code without a template code block

* fix lf
  • Loading branch information
riknoll committed May 23, 2024
1 parent 2205630 commit 03047d2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion webapp/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1961,8 +1961,15 @@ export class ProjectView

private async loadTutorialTemplateCodeAsync(): Promise<void> {
const header = pkg.mainEditorPkg().header;
if (!header || !header.tutorial || !header.tutorial.templateCode || header.tutorial.templateLoaded)
if (!header || !header.tutorial) {
return;
}
else if (!header.tutorial.templateCode || header.tutorial.templateLoaded) {
if (header.tutorial.mergeCarryoverCode && header.tutorial.mergeHeaderId) {
console.warn(lf("Refusing to carry code between tutorials because the loaded tutorial \"{0}\" does not contain a template code block.", header.tutorial.tutorial));
}
return;
}

const template = header.tutorial.templateCode;

Expand Down

0 comments on commit 03047d2

Please sign in to comment.