From 027f11ee5276511b1e79452f605878efc16228eb Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Wed, 9 Oct 2024 09:13:10 +0100 Subject: [PATCH] Fixed erroneous 'no detections found using the custom list" mentioned in #136 --- js/ui.js | 5 +++-- js/worker.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/ui.js b/js/ui.js index 8d4f77c0..ce8d85df 100644 --- a/js/ui.js +++ b/js/ui.js @@ -2615,8 +2615,9 @@ function onChartData(args) { updateListIcon(); updatePrefs('config.json', config) resetResults({clearSummary: true, clearPagination: true, clearResults: true}); - setListUIState(config.list) - worker.postMessage({ action: 'update-list', list: config.list, refreshResults: STATE.analysisDone }) + setListUIState(config.list); + // Since the custom list function calls for its own update *after* reading the labels, we'll skip updates for custom lists here + config.list === 'custom' || worker.postMessage({ action: 'update-list', list: config.list, refreshResults: STATE.analysisDone }) }) DOM.customListSelector.addEventListener('click', async () =>{ diff --git a/js/worker.js b/js/worker.js index 9b52c883..bbd4d091 100644 --- a/js/worker.js +++ b/js/worker.js @@ -582,7 +582,8 @@ async function spawnListWorker() { return function listWorker(message_1) { return new Promise((resolve_1, reject_1) => { worker_1.onmessage = function (event_1) { - resolve_1(event_1.data); + const { result, messages } = event_1.data; + resolve_1({ result, messages }); }; worker_1.onerror = function (error_1) {