You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/06/06 08:57:06 UTC

[incubator-ponymail-foal] branch master updated: regen JS

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new 7f57be6  regen JS
7f57be6 is described below

commit 7f57be60682bc4f62a516feaf34ace3d4c0f7597
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sun Jun 6 10:56:53 2021 +0200

    regen JS
---
 webui/js/ponymail.js | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 23c1624..f8f57cf 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -66,7 +66,10 @@ async function escrow_check() {
 async function async_snap(error) {
     msg = await error.text();
     msg = msg.replace(/<.*?>/g, ""); // strip HTML tags
-    modal("An error occured", "An error code %u occured while trying to fetch %s:\n%s".format(error.status, error.url, msg), "error");
+    if (error.status === 404) {
+        msg += "\n\nYou may need to be logged in with additional permissions in order to view this resoruce.";
+    }
+    modal("An error occured", "An error code %u occured while trying to fetch %s:\n%s%s".format(error.status, error.url, msg), "error");
 }
 
 
@@ -791,9 +794,13 @@ function construct_thread(thread, cid, nestlevel, included) {
 // Singular thread construction via permalinks
 function construct_single_thread(state, json) {
     current_json = json;
-    if (json && json.error) {
-        modal("An error occured", "Sorry, we hit a snag while trying to load the email(s): \n\n%s".format(json.error), "error");
-        return;
+    if (json) {
+        // Old schema has json.error filled on error, simplified schema has json.message filled and json.okay set to false
+        let error_message = json.okay === false ? json.message : json.error;
+        if (error_message) {
+            modal("An error occured", "Sorry, we hit a snag while trying to load the email(s): \n\n%s".format(error_message), "error");
+            return;
+        }
     }
     let div = document.getElementById('emails');
     div.innerHTML = "";