Skip to content

Commit

Permalink
Fix: Preview not available for password protected buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
psi-4ward committed May 14, 2017
1 parent d2ff073 commit 71bf7bb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/src/Download.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 71bf7bb

Please sign in to comment.