From 98af46addd0978c0a8d6893f16a9b46d548b06e7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 14 Nov 2021 16:13:06 +0300 Subject: [PATCH] prefs: properly report failures when loading plugin list --- js/PrefHelpers.js | 7 +++++++ 1 file changed, 7 insertions(+) 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 = `
  • ${__("Error while loading plugins list: %s.").replace("%s", e)}
  • `; + }, render_contents: function() { const container = document.querySelector(".prefs-plugin-list");