From a0b42c7074d8748f2488a4c2a316a69c19c9d762 Mon Sep 17 00:00:00 2001 From: mattk70 Date: Wed, 9 Oct 2024 00:50:19 +0100 Subject: [PATCH] better message when library is up to date --- js/worker.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/js/worker.js b/js/worker.js index 92c1eb9b..9b52c883 100644 --- a/js/worker.js +++ b/js/worker.js @@ -3625,17 +3625,20 @@ async function convertAndOrganiseFiles(threadLimit) { failureReasons.push(result.reason); // Collect the reason for the failure } }); - + const attempted = successfulConversions + failedConversions; // Create a summary message - let summaryMessage = `Processing complete: ${successfulConversions} successful, ${failedConversions} failed.`; - - if (failedConversions > 0) { - summaryMessage += `
Failed conversion reasons:
`; - } + let summaryMessage; + + if (attempted) { + summaryMessage = `Processing complete: ${successfulConversions} successful, ${failedConversions} failed.`; + if (failedConversions > 0) { + summaryMessage += `
Failed conversion reasons:
`; + } + } else { summaryMessage = 'Library is up to date. Nothing to do'} // Post the summary message UI.postMessage({