Skip to content

Commit

Permalink
clarified the distinction between processing-complete, database-resul…
Browse files Browse the repository at this point in the history
…ts-complete and analysis-complete
  • Loading branch information
Mattk70 committed Feb 22, 2024
1 parent 5bf3e29 commit eca56b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,8 @@ const setUpWorkerMessaging = () => {
generateToast({ message: args.message});
break;
}
case "results-complete": {onResultsComplete(args);
// Called when last result is returned from a database query
case "database-results-complete": {onResultsComplete(args);
hideLoadingSpinner();
break;
}
Expand Down Expand Up @@ -1641,10 +1642,10 @@ const setUpWorkerMessaging = () => {
case "progress": {onProgress(args);
break;
}
// called when an analysis ends, or when the filesbeingprocessed list is empty
case "processing-complete": {
STATE.analysisDone = true;
PREDICTING = false;
DOM.progressDiv.classList.add('d-none');
break;
}
case 'ready-for-tour':{
Expand Down Expand Up @@ -2784,7 +2785,7 @@ function onChartData(args) {
}

/*
onResultsComplete is called when the last result is sent
onResultsComplete is called when the last result is sent from the database
*/
function onResultsComplete({active = undefined, select = undefined} = {}){
let table = document.getElementById('resultTableBody');
Expand Down
7 changes: 3 additions & 4 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,8 @@ const prepSummaryStatement = (included) => {
}
if (!filesBeingProcessed.length) {
if (!STATE.selection) getSummary();
//UI.postMessage({event: 'processing-complete'})
// Need this here in case last file is not sent for analysis (e.g. nocmig mode)
UI.postMessage({event: 'processing-complete'})
}
}

Expand Down Expand Up @@ -2401,7 +2402,7 @@ const prepSummaryStatement = (included) => {
}
}
}
STATE.selection || UI.postMessage({event: 'results-complete', active: active, select: select?.start});
STATE.selection || UI.postMessage({event: 'database-results-complete', active: active, select: select?.start});
};

// Function to format the CSV export
Expand Down Expand Up @@ -3125,8 +3126,6 @@ async function setIncludedIDs(lat, lon, week) {

if (STATE.included === undefined) STATE.included = {}
STATE.included = merge(STATE.included, includedObject);
//UI.postMessage({ event: "results-complete" });

return STATE.included;
})();

Expand Down

0 comments on commit eca56b4

Please sign in to comment.