From 69677b15feb8852ff962116d8a2b9dfb78ad4f63 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 22 Apr 2019 15:01:05 +0200 Subject: [PATCH] fix broken file download --- package-lock.json | 2 +- src/public/javascripts/services/note_detail_file.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 685633b79..854eba822 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "trilium", - "version": "0.30.6", + "version": "0.30.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/public/javascripts/services/note_detail_file.js b/src/public/javascripts/services/note_detail_file.js index 23f8e9f06..8bb8ca605 100644 --- a/src/public/javascripts/services/note_detail_file.js +++ b/src/public/javascripts/services/note_detail_file.js @@ -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 {