From e095e15f476cb9a94c9953137875572cad345ce8 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 11 Nov 2013 14:10:11 -0800 Subject: because some of the "hints" floating around are pretty pathetic and ambiguous and require a few tries. --- js/crypto.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/crypto.js b/js/crypto.js index 702ebd0e1..9e8a43f55 100644 --- a/js/crypto.js +++ b/js/crypto.js @@ -97,7 +97,17 @@ function red_decrypt(alg,hint,text,elem) { // wipe out the text and make you re-enter the key if it was in the // conversation. For now we do that so you can read it. - $(elem).html(b2h(enc_text.toString(CryptoJS.enc.Utf8))); + var enc_result = enc_text.toString(CryptoJS.enc.Utf8); + delete enc_text; + + // incorrect decryptions *usually* but don't always have zero length + // If the person typo'd let them try again without reloading the page + // otherwise they'll have no "padlock" to click to try again. + + if(enc_result.length) { + $(elem).html(b2h(enc_result)); + enc_result = ''; + } } -- cgit v1.2.3