From 38c59c35aaf56a20a8f99c11ddeb0bda57d2a793 Mon Sep 17 00:00:00 2001 From: Saumya Jain Date: Thu, 22 Aug 2024 11:27:42 +0200 Subject: [PATCH] Fix GCode prefix formatting in EmscriptenCommunication Ensure the prefix argument is correctly formatted as a string in JavaScript function calls. This change prevents potential issues with GCode prefix handling in the communication module as it starts with ';' NP-327 --- src/communication/EmscriptenCommunication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/communication/EmscriptenCommunication.cpp b/src/communication/EmscriptenCommunication.cpp index d5504add7e..d929a204cb 100644 --- a/src/communication/EmscriptenCommunication.cpp +++ b/src/communication/EmscriptenCommunication.cpp @@ -41,7 +41,7 @@ EmscriptenCommunication::EmscriptenCommunication(const std::vector& void EmscriptenCommunication::sendGCodePrefix(const std::string& prefix) const { - emscripten_run_script(fmt::format("globalThis[\"{}\"]({})", gcode_prefix_handler_, prefix).c_str()); + emscripten_run_script(fmt::format("globalThis[\"{}\"](\"{}\")", gcode_prefix_handler_, prefix).c_str()); } void EmscriptenCommunication::sendProgress(double progress) const