Skip to content

Commit

Permalink
🐛 Fix background page reset on background removal
Browse files Browse the repository at this point in the history
Regression of ef51c79
  • Loading branch information
foosel committed May 24, 2024
1 parent 806aae5 commit d8d46ae
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/assets/cardfoldr.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,19 @@ const refreshPdf = async (changed) => {

const jobs = [];

if (changed.includes("pdf") && pdf) {
if (changed.includes("pdf")) {
clearPages(pagesContainer);
jobs.push(renderPages(pdf, pagesContainer, "page", "Page ", pageSelection));
if (pdf) {
jobs.push(renderPages(pdf, pagesContainer, "page", "Page ", pageSelection));
}
}

if (changed.includes("background") && backgroundPdf) {
if (changed.includes("background")) {
const backgroundPagesContainer = document.getElementById('pages-back');
clearPages(backgroundPagesContainer);
jobs.push(renderPages(backgroundPdf, backgroundPagesContainer, "background-page", "Backs page ", backgroundPageSelection));
if (backgroundPdf) {
jobs.push(renderPages(backgroundPdf, backgroundPagesContainer, "background-page", "Backs page ", backgroundPageSelection));
}
}

await Promise.all(jobs);
Expand Down

0 comments on commit d8d46ae

Please sign in to comment.