From 3ba9e6592cb06e85b3d938612eecba296d32504d Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Thu, 22 Feb 2024 00:59:20 +0530 Subject: [PATCH] filename bug fix, gcode nextline fix, --- src/js/macros.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/macros.js b/src/js/macros.js index 30feecf..0a8d276 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -99,12 +99,14 @@ module.exports = { } const file = this.fileName; if (file != "default") { - const response = await fetch(`/api/file/EgZjaHJvbWUqCggBEAAYsQMYgAQyBggAEEUYOTIKCAE${file}`, { - cache: "no-cache", - }); + const response = await fetch( + `/api/file/EgZjaHJvbWUqCggBEAAYsQMYgAQyBggAEEUYOTIKCAE${encodeURIComponent(file)}`, + { + cache: "no-cache", + }, + ); if (response.status == 200) { const text = await response.text(); - console.log("text: ", text); this.newGcode = text; } else { console.error("error loading");