Fit Height
diff --git a/js/crypto.js b/js/crypto.js
index 16f31b8..f33088c 100644
--- a/js/crypto.js
+++ b/js/crypto.js
@@ -17,6 +17,7 @@ function loadKeyFromLocalStorage(callback) {
callback("Key already loaded.", true);
return;
}
+ $("#lockstatus").css("display", "none");
if (!inStorage("signingkey") || getStorage("signingkey") == "undefined") {
var pass = prompt("Generating a new signing key (might take a while, be patient). Enter a password to protect it. You'll need to save this password somewhere safe; it cannot be recovered.");
generatePrivateKey(getStorage("notary_name") + "
", pass, function (key) {
@@ -41,6 +42,11 @@ function loadKeyFromLocalStorage(callback) {
}
}
+function unloadKey() {
+ keymgr = undefined;
+ $("#lockstatus").css("display", "");
+}
+
function loadKeyFromLocalStorageWithUserFeedback() {
loadKeyFromLocalStorage(function (msg, ok) {
if (ok) {
@@ -223,4 +229,17 @@ function importPrivateKey() {
alert("Private key imported.");
});
}, ".asc");
-}
\ No newline at end of file
+}
+
+
+/**
+ * Show visual indicator when private key is not loaded/unlocked.
+ * @returns {undefined}
+ */
+setInterval(function () {
+ if (typeof keymgr == "undefined") {
+ $("#lockstatus").css("display", "");
+ } else {
+ $("#lockstatus").css("display", "none");
+ }
+}, 1000);
\ No newline at end of file