From 71bf7bb8b1819c0547a26b8786f2e107f4c2b37a Mon Sep 17 00:00:00 2001 From: Christoph Wiechert Date: Sun, 14 May 2017 21:19:53 +0200 Subject: [PATCH] Fix: Preview not available for password protected buckets --- app/src/Download.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/Download.vue b/app/src/Download.vue index b931318..3ac04f1 100644 --- a/app/src/Download.vue +++ b/app/src/Download.vue @@ -135,12 +135,13 @@ this.passwordWrong = false; this.files = this.files.map(item => { if(typeof item === 'object') return item; - const d = AES.decrypt(item, this.password); + let f = AES.decrypt(item, this.password); try { - return Object.assign( - JSON.parse(d.toString(encUtf8)), - {downloaded: false} - ); + f = JSON.parse(f.toString(encUtf8)); + return Object.assign(f, { + downloaded: false, + previewType: getPreviewType(f, this.config.maxPreviewSize) + }); } catch(e) { this.passwordWrong = true; return item;