diff --git a/plugins/Sidebar/media/Sidebar.coffee b/plugins/Sidebar/media/Sidebar.coffee index fb78370b..0ddc0800 100644 --- a/plugins/Sidebar/media/Sidebar.coffee +++ b/plugins/Sidebar/media/Sidebar.coffee @@ -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 diff --git a/plugins/Sidebar/media/all.js b/plugins/Sidebar/media/all.js index 1a9725a9..c09d2ee4 100644 --- a/plugins/Sidebar/media/all.js +++ b/plugins/Sidebar/media/all.js @@ -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; };