Fixes bug with unfinished filename extension (file.p)

This commit is contained in:
Dimitrios Kaitantzidis 2023-10-15 18:35:39 +03:00
parent 53a0291cc2
commit d0ce7db9ee

View file

@ -228,8 +228,16 @@ class PdfContainer {
const filenameInput = document.getElementById('filename-input'); const filenameInput = document.getElementById('filename-input');
let inputArr = filenameInput.value.split('.');
if (inputArr !== null && inputArr !== undefined && inputArr.length > 0) {
filenameInput.value = inputArr[0];
this.filename = filenameInput.value;
}
if (!filenameInput.value.includes('.pdf')) { if (!filenameInput.value.includes('.pdf')) {
filenameInput.value = filenameInput.value + '.pdf'; filenameInput.value = filenameInput.value + '.pdf';
this.filename = filenameInput.value;
} }
if (downloadOption === 'sameWindow') { if (downloadOption === 'sameWindow') {