summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-11-14 16:13:06 +0300
committerAndrew Dolgov <[email protected]>2021-11-14 16:13:06 +0300
commit98af46addd0978c0a8d6893f16a9b46d548b06e7 (patch)
tree240d10b6074a677928d8394ca93750fdb1055e5e /js
parentcf933716075ea98ec1004544734a3158ed07a577 (diff)
prefs: properly report failures when loading plugin list
Diffstat (limited to 'js')
-rw-r--r--js/PrefHelpers.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js
index 30a4544fe..ce3046210 100644
--- a/js/PrefHelpers.js
+++ b/js/PrefHelpers.js
@@ -363,8 +363,15 @@ const Helpers = {
xhr.json("backend.php", {op: "pref-prefs", method: "getPluginsList"}, (reply) => {
this._list_of_plugins = reply;
this.render_contents();
+ }, (e) => {
+ this.render_error(e);
});
},
+ render_error: function(e) {
+ const container = document.querySelector(".prefs-plugin-list");
+
+ container.innerHTML = `<li class='text-error'>${__("Error while loading plugins list: %s.").replace("%s", e)}</li>`;
+ },
render_contents: function() {
const container = document.querySelector(".prefs-plugin-list");