Remove calls to non-existant element

This commit is contained in:
Connor Yoh 2025-04-14 11:58:58 +01:00
parent 5a2128565e
commit efb9c4173a

View File

@ -41,13 +41,10 @@ export class DeletePageCommand extends Command {
}
const filenameInput = document.getElementById("filename-input");
const filenameParagraph = document.getElementById("filename");
const downloadBtn = document.getElementById("export-button");
filenameInput.disabled = false;
filenameInput.value = this.filenameInputValue;
if (this.filenameParagraph)
filenameParagraph.innerText = this.filenameParagraphText;
downloadBtn.disabled = false;
}
@ -61,12 +58,10 @@ export class DeletePageCommand extends Command {
this.pagesContainer.removeChild(this.element);
if (this.pagesContainer.childElementCount === 0) {
const filenameInput = document.getElementById("filename-input");
const filenameParagraph = document.getElementById("filename");
const downloadBtn = document.getElementById("export-button");
filenameInput.disabled = true;
filenameInput.value = "";
filenameParagraph.innerText = "";
downloadBtn.disabled = true;
}