Skip to content

Commit

Permalink
better message when library is up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Oct 8, 2024
1 parent 3b1e9ff commit a0b42c7
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 += `<br>Failed conversion reasons:<br><ul>`;
failureReasons.forEach(reason => {
summaryMessage += `<li>${reason}</li>`;
});
summaryMessage += `</ul>`;
}
let summaryMessage;

if (attempted) {
summaryMessage = `Processing complete: ${successfulConversions} successful, ${failedConversions} failed.`;
if (failedConversions > 0) {
summaryMessage += `<br>Failed conversion reasons:<br><ul>`;
failureReasons.forEach(reason => {
summaryMessage += `<li>${reason}</li>`;
});
summaryMessage += `</ul>`;
}
} else { summaryMessage = 'Library is up to date. Nothing to do'}

// Post the summary message
UI.postMessage({
Expand Down

0 comments on commit a0b42c7

Please sign in to comment.