Confirmation of private key forgot

This commit is contained in:
shortcutme 2018-10-04 15:43:25 +02:00
parent c70e3bb3dd
commit 678f4102a5
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 12 additions and 4 deletions

View file

@ -210,8 +210,11 @@ class Sidebar extends Class
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
@wrapper.displayConfirm "Remove saved prive key for this site?", "Forgot", (res) =>
if not res
return false
@wrapper.ws.cmd "userSetSitePrivatekey", [""], (res) =>
@wrapper.notifications.add "privatekey", "done", "Saved private key removed", 5000
return false

View file

@ -608,8 +608,13 @@ window.initScrollable = function () {
})(this));
return this.tag.find("#privatekey-forgot").off("click, touchend").on("click touchend", (function(_this) {
return function(e) {
_this.wrapper.ws.cmd("userSetSitePrivatekey", [""], function(res) {
return _this.wrapper.notifications.add("privatekey", "done", "Saved private key removed", 5000);
_this.wrapper.displayConfirm("Remove saved prive key for this site?", "Forgot", function(res) {
if (!res) {
return false;
}
return _this.wrapper.ws.cmd("userSetSitePrivatekey", [""], function(res) {
return _this.wrapper.notifications.add("privatekey", "done", "Saved private key removed", 5000);
});
});
return false;
};