fix broken file download

This commit is contained in:
zadam 2019-04-22 15:01:05 +02:00
parent cdb17ae937
commit 69677b15fe
2 changed files with 5 additions and 2 deletions

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "trilium",
"version": "0.30.6",
"version": "0.30.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -34,6 +34,9 @@ async function show() {
else {
$previewRow.hide();
}
// open doesn't work for protected notes since it works through browser which isn't in protected session
$openButton.toggle(!currentNote.isProtected);
}
$downloadButton.click(() => utils.download(getFileUrl()));
@ -51,7 +54,7 @@ $openButton.click(() => {
function getFileUrl() {
// electron needs absolute URL so we extract current host, port, protocol
return utils.getHost() + "/api/notes/" + noteDetailService.getCurrentNoteId();
return utils.getHost() + "/api/notes/" + noteDetailService.getCurrentNoteId() + "/download";
}
export default {