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:
parent
17d607ef14
commit
11e3474e8d
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user