From 5a83259233cd0204b8f987d0d8ccc536e01d334d Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 18 May 2017 18:24:04 +0200 Subject: [PATCH] listen for decryption errors --- www/media/main.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/www/media/main.js b/www/media/main.js index 044fba0c0..08efb7714 100644 --- a/www/media/main.js +++ b/www/media/main.js @@ -70,11 +70,16 @@ define([ var decrypted = e.originalEvent; var metadata = decrypted.metadata; - console.log(metadata); - console.log(defaultName); + if (decrypted.callback) { decrypted.callback(); } + //console.log(metadata); + //console.log(defaultName); if (!metadata || metadata.name !== defaultName) { return; } var title = document.title = metadata.name; updateTitle(title || defaultName); + }) + .on('decryptionError', function (e) { + var error = e.originalEvent; + Cryptpad.alert(error.message); }); require(['/common/media-tag.js'], function (MediaTag) {