From 497baec5e91e9798e814dd381ad5188023fbbfa7 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 11 Jan 2024 16:32:56 +0100 Subject: [PATCH] feat: show fm graph in beginning of uvl tutorial and fix small error for diff edtior --- WebSocketClient/src/uvlTutorial.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WebSocketClient/src/uvlTutorial.ts b/WebSocketClient/src/uvlTutorial.ts index d80330d..4216ebf 100644 --- a/WebSocketClient/src/uvlTutorial.ts +++ b/WebSocketClient/src/uvlTutorial.ts @@ -4,6 +4,7 @@ import IStandaloneCodeEditor = editor.IStandaloneCodeEditor; import IIdentifiedSingleEditOperation = editor.IIdentifiedSingleEditOperation; import {editor} from "monaco-editor"; import IStandaloneDiffEditorConstructionOptions = editor.IStandaloneDiffEditorConstructionOptions; +import { sendGenerateGraphCommand } from "./main"; export default function initUvlTutorial(editor: editor.IStandaloneCodeEditor) { let tutorialToggle = false; @@ -22,6 +23,8 @@ export default function initUvlTutorial(editor: editor.IStandaloneCodeEditor) { thirdPane.style.width = "50%"; } setTutorialPage(mainDiv, tutorialPageCounter); + sendGenerateGraphCommand(); + } else { if (secondPane && thirdPane) { secondPane.style.width = "100%"; @@ -43,7 +46,7 @@ export default function initUvlTutorial(editor: editor.IStandaloneCodeEditor) { mainDiv.appendChild(tutorialDiv); let modifiedCode = tutorialContent[pageNumber].codeListing; - let originalCode = tutorialContent[pageNumber - 1].codeListing; + let originalCode = pageNumber !== 0 ? tutorialContent[pageNumber - 1].codeListing : undefined; if (modifiedCode && originalCode) { const paragraph = document.createElement("p"); paragraph.id = "hint";