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

sebb 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 10ad025  Ensure n is defined; move defs closer to usage
10ad025 is described below

commit 10ad02576a0d6bfce2d2ea6ae9aad0d98fd742ed
Author: Sebb <[email protected]>
AuthorDate: Fri Nov 26 12:22:23 2021 +0000

    Ensure n is defined; move defs closer to usage
---
 webui/js/source/listview-flat.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/webui/js/source/listview-flat.js b/webui/js/source/listview-flat.js
index f060b2e..7fcf169 100644
--- a/webui/js/source/listview-flat.js
+++ b/webui/js/source/listview-flat.js
@@ -40,6 +40,7 @@ function listview_flat(json, start) {
     list.innerHTML = "";
 
     let s = start || 0;
+    let n;
     if (json.emails && json.emails.length) {
         for (n = s; n < (s + G_current_per_page); n++) {
             let z = json.emails.length - n - 1; // reverse order by default
@@ -70,8 +71,6 @@ function listview_flat_element(eml, idx) {
     let element = new HTML('div', {
         class: G_current_listmode_compact ? "listview_email_compact" : 
"listview_email_flat"
     }, " ");
-    let date = new Date(eml.epoch * 1000.0);
-    let now = new Date();
 
     // Add gravatar
     let gravatar = new HTML('img', {
@@ -114,6 +113,10 @@ function listview_flat_element(eml, idx) {
     let labels = new HTML('div', {
         class: 'listview_email_labels'
     });
+
+    let date = new Date(eml.epoch * 1000.0);
+    let now = new Date();
+
     let dl = new HTML('span', {
         class: 'label label-default'
     }, date.ISOBare());

Reply via email to