2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

fix how the download path is calculated

This commit is contained in:
Ankit Singhaniya 2021-08-18 23:27:06 +05:30 committed by 18alantom
parent 17d607ef14
commit 11e3474e8d

View File

@ -90,24 +90,21 @@ export default {
let html = this.$refs.printContainer.innerHTML;
makePDF(html, destination);
},
getSavePath() {
return new Promise(resolve => {
remote.dialog.showSaveDialog(
remote.getCurrentWindow(),
{
title: this._('Select folder'),
defaultPath: `${this.name}.pdf`
},
filePath => {
if (filePath) {
if (!filePath.endsWith('.pdf')) {
filePath = filePath + '.pdf';
}
resolve(filePath);
}
}
);
});
async getSavePath() {
const options = {
title: this._('Select folder'),
defaultPath: `${this.name}.pdf`
};
let { filePath } = await remote.dialog.showSaveDialog(options);
console.log(filePath);
if (filePath) {
if (!filePath.endsWith('.pdf')) {
filePath = filePath + '.pdf';
}
}
return filePath;
}
}
};