From 41fefddc1634a82fd9e7ca55300110992ffa39a0 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 3 Oct 2016 19:11:26 +0200 Subject: [PATCH] Issue fixed --- web/app/js/app.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/web/app/js/app.js b/web/app/js/app.js index 52489df..4ce91e0 100644 --- a/web/app/js/app.js +++ b/web/app/js/app.js @@ -140,6 +140,8 @@ var viewerEvents = function() { var $cipherEditor = $('.cipher-editor'); var $embedInput = $('#embed-input'); + var to = ' '; + if (key) { $('.cipher-link').each(function() { var href = $(this).attr('href'); @@ -148,10 +150,7 @@ var viewerEvents = function() { $(this).attr('href', href); }); - var to = ' '; - if (0 !== $render.length || $cipherEditor.length !== 0) { - if ($render.length !== 0) { var decrypted = CryptoJS.AES.decrypt($render.html(), key, { format: JsonFormatter @@ -169,10 +168,10 @@ var viewerEvents = function() { $cipherEditor.val(decrypted.toString(CryptoJS.enc.Utf8)); } } + } - if ($embedInput.length) { - $embedInput.val($embedInput.val().replace('%key%', to)); - } + if ($embedInput.length) { + $embedInput.val($embedInput.val().replace('%key%', to)); } }); }