better error handling in file download

This commit is contained in:
ansuz 2017-05-12 16:17:00 +02:00
parent 42f3a62cac
commit 69e933dd17

View file

@ -175,8 +175,8 @@ define([
if (!uploadMode) {
var src = Cryptpad.getBlobPathFromHex(hexFileName);
return Cryptpad.fetch(src, function (e, u8) {
if (e) { return void Cryptpad.alert(e); }
// now decrypt the u8
if (e) { return window.alert('error'); }
var cryptKey = secret.keys && secret.keys.fileKeyStr;
var key = Nacl.util.decodeBase64(cryptKey);