Private key save and fogot to sidebar

This commit is contained in:
shortcutme 2018-09-21 02:17:53 +02:00
parent 2a1849d027
commit 8fd2af1870
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
5 changed files with 57 additions and 7 deletions

View file

@ -202,6 +202,19 @@ class Sidebar extends Class
return true
}
# Save and forgot privatekey for site signing
@tag.find("#privatekey-add").off("click, touchend").on "click touchend", (e) =>
@wrapper.displayPrompt "Enter your private key:", "password", "Save", "", (privatekey) =>
@wrapper.ws.cmd "userSetSitePrivatekey", [privatekey], (res) =>
@wrapper.notifications.add "privatekey", "done", "Private key saved for site signing", 5000
return false
@tag.find("#privatekey-forgot").off("click, touchend").on "click touchend", (e) =>
@wrapper.ws.cmd "userSetSitePrivatekey", [""], (res) =>
@wrapper.notifications.add "privatekey", "done", "Saved private key removed", 5000
return false
animDrag: (e) =>
mousex = e.pageX