From 66de0de58b5f8a71d6a8a937c28cf8fddaa51532 Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Fri, 22 Mar 2024 18:40:56 +0000 Subject: [PATCH] don't send analysis-complete in parseMessage, send it in updateFilesBeingProcessed --- js/ui.js | 4 +++- js/worker.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/js/ui.js b/js/ui.js index 20a52d50..9e8725b3 100644 --- a/js/ui.js +++ b/js/ui.js @@ -3623,7 +3623,9 @@ function onChartData(args) { DOM.resultHeader.classList.remove('text-bg-secondary'); DOM.resultHeader.classList.add('text-bg-dark'); // Add a hover to summary to indicate activation - document.getElementById('resultSummary').classList.add('table-hover'); + const summary = document.getElementById('resultSummary'); + // If there were no results, there'll be no summary + summary?.classList.add('table-hover'); } const setSortOrder = (order) => { diff --git a/js/worker.js b/js/worker.js index 43e33164..4111ac1f 100644 --- a/js/worker.js +++ b/js/worker.js @@ -2074,7 +2074,7 @@ async function parseMessage(e) { if (filesBeingProcessed.length) { processNextFile({ worker: worker }); } else if ( !STATE.selection) { - getSummary().then(() => UI.postMessage({event: "analysis-complete"})); + getSummary() //.then(() => UI.postMessage({event: "analysis-complete"})); } else { UI.postMessage({event: "analysis-complete"}); } @@ -2101,7 +2101,7 @@ function updateFilesBeingProcessed(file) { if (!filesBeingProcessed.length) { if (!STATE.selection) getSummary(); // Need this here in case last file is not sent for analysis (e.g. nocmig mode) - UI.postMessage({event: 'processing-complete'}) + UI.postMessage({event: 'analysis-complete'}) } } @@ -2124,7 +2124,7 @@ async function processNextFile({ // Nothing to do for this file updateFilesBeingProcessed(file); - const result = `No detections. ${file} has no period within it where predictions would be given. Tip: To see detections in this file, disable nocmig mode.`; + const result = `No detections. ${file} has no period within it where predictions would be given. Tip: To see detections in this file, disable nocmig mode and run the analysis again.`; UI.postMessage({ event: 'new-result', file: file, result: result, index: index