Show error message when db failed to rebuild (#2043)

* Show error message when db failed to rebuild; fix #1908;

* Forgot file
This commit is contained in:
Lola Dam 2019-06-04 13:54:35 +02:00 committed by ZeroNet
parent d38846f126
commit 9cda561091
4 changed files with 19 additions and 4 deletions

View file

@ -814,8 +814,15 @@ window.initScrollable = function () {
this.tag.find("#button-dbrebuild").off("click touchend").on("click touchend", (function(_this) {
return function() {
_this.wrapper.notifications.add("done-dbrebuild", "info", "Database rebuilding....");
_this.wrapper.ws.cmd("dbRebuild", [], function() {
_this.wrapper.ws.cmd("dbRebuild", [], function(response) {
if (response !== "ok") {
_this.wrapper.notifications.add("done-dbrebuild", "error", response.error, 5000);
return _this.updateHtmlTag();
}
_this.wrapper.notifications.add("done-dbrebuild", "done", "Database rebuilt!", 5000);
return _this.updateHtmlTag();
});
return false;
@ -1477,4 +1484,4 @@ function morphdom(fromNode, toNode, options) {
module.exports = morphdom;
},{}]},{},[1])(1)
});
});