From 86548e5cc120518eff8a1290479aba28e76f7240 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 27 Aug 2019 13:46:09 +0200 Subject: [PATCH] Fix wrong fileHost when displaying thumbnails --- www/common/common-thumbnail.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/common-thumbnail.js b/www/common/common-thumbnail.js index 9d52f130b..c22e2acee 100644 --- a/www/common/common-thumbnail.js +++ b/www/common/common-thumbnail.js @@ -289,9 +289,11 @@ define([ var parsed = Hash.parsePadUrl(href); var k = getKey(parsed.type, channel); var whenNewThumb = function () { + var privateData = common.getMetadataMgr().getPrivateData(); + var fileHost = privateData.fileHost || privateData.origin; var secret = Hash.getSecrets('file', parsed.hash, password); var hexFileName = secret.channel; - var src = Hash.getBlobPathFromHex(hexFileName); + var src = fileHost + Hash.getBlobPathFromHex(hexFileName); var key = secret.keys && secret.keys.cryptKey; FileCrypto.fetchDecryptedMetadata(src, key, function (e, metadata) { if (e) {