Parcourir la source

Merge pull request #4246 from JanzenJohn/develop

Remove infinite requests loop
jc21 il y a 10 mois
Parent
commit
f90d839ebe
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      frontend/js/app/dashboard/main.js

+ 3 - 1
frontend/js/app/dashboard/main.js

@@ -50,7 +50,8 @@ module.exports = Mn.View.extend({
     onRender: function () {
         let view = this;
 
-        Api.Reports.getHostStats()
+        if (typeof view.stats.hosts === 'undefined') {
+            Api.Reports.getHostStats()
                 .then(response => {
                     if (!view.isDestroyed()) {
                         view.stats.hosts = response;
@@ -60,6 +61,7 @@ module.exports = Mn.View.extend({
                 .catch(err => {
                     console.log(err);
                 });
+        }
     },
 
     /**