+

Fix home view when user not connected

Benjamin Renard [2016-09-12 22:16:31]
Fix home view when user not connected
Filename
inc/myco.js
diff --git a/inc/myco.js b/inc/myco.js
index d4f84f3..c177b4d 100644
--- a/inc/myco.js
+++ b/inc/myco.js
@@ -109,8 +109,11 @@ view_home=function() {
           sum+=value;
           diff='<td class="positive">+'+value.toFixed(2)+' €</td>';
         }
-        tbody.html(tbody.html()+'<tr><td><a class="group-link" data-uuid="'+g+'">'+balances[g].name+'</a></td>'+diff+'</tr>');
       }
+      else {
+        diff=$('<td>&nbsp;</td>');
+      }
+      tbody.html(tbody.html()+'<tr><td><a class="group-link" data-uuid="'+g+'">'+balances[g].name+'</a></td>'+diff+'</tr>');
     }
     $('#view-home #mybalances a.group-link').bind('click',function(e) {
       g=$(e.target).data('uuid');
ViewGit