community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1872887 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/generators.js wizard.js
Date Thu, 16 Jan 2020 17:31:56 GMT
Author: humbedooh
Date: Thu Jan 16 17:31:56 2020
New Revision: 1872887

URL: http://svn.apache.org/viewvc?rev=1872887&view=rev
Log:
don't show any releases twice, it messes up things

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js?rev=1872887&r1=1872886&r2=1872887&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js Thu Jan 16 17:31:56
2020
@@ -488,15 +488,17 @@ function activity_tips(data) {
     ages = ages.splice(0,new_releases >= 3 ? new_releases : 3);
     let to_show = ages.length;
     let releases_shown = 0;
+    let releases_picked = {};
     while (ages.length) {
       let ts = ages.shift();
       for (var rel in data.releases[project]) {
-        if (releases_shown == to_show) break;
+        if (releases_shown >= to_show) break;
           let reldate = moment(data.releases[project][rel] * 1000.0);
+          if (releases_picked[rel]) continue;
           if (ts == reldate.unix()) {
               rtxt += "<li>%s was released on %s.</li>".format(rel, reldate.utc().format('YYYY-MM-DD'));
               releases_shown++;
-              continue;
+              releases_picked[rel] = true;
           }
       }
     }

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1872887&r1=1872886&r2=1872887&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Thu Jan 16 17:31:56 2020
@@ -1703,15 +1703,17 @@ function activity_tips(data) {
     ages = ages.splice(0,new_releases >= 3 ? new_releases : 3);
     let to_show = ages.length;
     let releases_shown = 0;
+    let releases_picked = {};
     while (ages.length) {
       let ts = ages.shift();
       for (var rel in data.releases[project]) {
-        if (releases_shown == to_show) break;
+        if (releases_shown >= to_show) break;
           let reldate = moment(data.releases[project][rel] * 1000.0);
+          if (releases_picked[rel]) continue;
           if (ts == reldate.unix()) {
               rtxt += "<li>%s was released on %s.</li>".format(rel, reldate.utc().format('YYYY-MM-DD'));
               releases_shown++;
-              continue;
+              releases_picked[rel] = true;
           }
       }
     }



Mime
View raw message