From b89a2df462c152323705858c62fa285923a9d7d5 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 4 May 2020 10:03:54 +0200 Subject: [PATCH] fix image being redownloaded from localhost --- src/public/app/widgets/note_tree.js | 11 ++++++++++- src/services/notes.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index 8e897d7fd..f99a0b2d1 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -51,7 +51,7 @@ const TPL = ` position: absolute; top: 10px; right: 20px; - z-index: 1000; + z-index: 100; } .tree-settings-popup { @@ -514,6 +514,15 @@ export default class NoteTreeWidget extends TabAwareWidget { return; } + if (parentNote.title === 'Siemens M55') { + console.log("this.hideIncludedImages", this.hideIncludedImages); + console.log("this.hideIncludedImages", this.hideIncludedImages); + console.log("parentNote.getRelations('imageLink')", parentNote.getRelations('imageLink')); + console.log("parentNote.getRelations('imageLink')", parentNote.getRelations('imageLink')); + const imageLinks = parentNote.getRelations('imageLink'); + console.log("childBranches.filter(branch => !imageLinks.find(rel => rel.value === branch.noteId))", childBranches.filter(branch => !imageLinks.find(rel => rel.value === branch.noteId))); + } + if (this.hideIncludedImages) { const imageLinks = parentNote.getRelations('imageLink'); diff --git a/src/services/notes.js b/src/services/notes.js index c8948dbee..4df9846e8 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -290,7 +290,7 @@ async function downloadImages(noteId, content) { while (match = re.exec(origContent)) { const url = match[1]; - if (!url.startsWith('api/images/') + if (!url.includes('api/images/') // this is and exception for the web clipper's "imageId" && (url.length !== 20 || url.toLowerCase().startsWith('http'))) { if (url in downloadImagePromises) {