From dbdeb81a21947f58179b11f2f2fac471c08ac8f4 Mon Sep 17 00:00:00 2001 From: Will Greenberg Date: Tue, 8 Oct 2024 13:35:43 -0700 Subject: [PATCH] daemon: fix some bugs in the frontend js --- bin/static/js/main.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/static/js/main.js b/bin/static/js/main.js index 5a19dbd..b049728 100644 --- a/bin/static/js/main.js +++ b/bin/static/js/main.js @@ -43,17 +43,15 @@ async function updateAnalysisStatus(qmdlManifest) { } function parseNewlineDelimitedJSON(inputStr) { - if(! inputStr.includes("{")) { - inputStr = atob(inputStr).replaceAll("}{", "}\n{") - } const lines = inputStr.split('\n'); const result = []; let currentLine = ''; while (lines.length > 0) { - currentLine = lines.shift(); + currentLine += lines.shift(); try { const entry = JSON.parse(currentLine); result.push(entry); + currentLine = ''; // if this chunk wasn't valid JSON, there was an escaped newline in the // JSON line, so simply continue to the next one } catch (e) {}