aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-11 14:10:11 -0800
committerfriendica <info@friendica.com>2013-11-11 14:10:11 -0800
commite095e15f476cb9a94c9953137875572cad345ce8 (patch)
tree7de4545efd0f9b8d44107f6d9ac1072eace0e273 /js
parentb5bc04799c9f2fec82bbd0e9823a384118ea14c1 (diff)
downloadvolse-hubzilla-e095e15f476cb9a94c9953137875572cad345ce8.tar.gz
volse-hubzilla-e095e15f476cb9a94c9953137875572cad345ce8.tar.bz2
volse-hubzilla-e095e15f476cb9a94c9953137875572cad345ce8.zip
because some of the "hints" floating around are pretty pathetic and ambiguous and require a few tries.
Diffstat (limited to 'js')
-rw-r--r--js/crypto.js12
1 files changed, 11 insertions, 1 deletions
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 = '';
+ }
}