From 3264f6151e288ad73ab7bd5831fe2a562e55d834 Mon Sep 17 00:00:00 2001 From: paulober <44974737+paulober@users.noreply.github.com> Date: Mon, 9 Sep 2024 18:25:51 +0100 Subject: [PATCH] Fix project name validation for non examples Signed-off-by: paulober <44974737+paulober@users.noreply.github.com> --- web/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/main.js b/web/main.js index 1aa5c13..6854532 100644 --- a/web/main.js +++ b/web/main.js @@ -27,7 +27,10 @@ var exampleSupportedBoards = []; // returns true if project name input is valid function projectNameFormValidation(projectNameElement) { - if (typeof examples !== 'undefined') { + // TODO: put into helper function + const createFromExampleBtn = document.getElementById('btn-create-from-example'); + const isExampleMode = createFromExampleBtn ? createFromExampleBtn.getAttribute('data-example-mode') === 'true' : true; + if (isExampleMode) { return true; }