Browse Source

Fix stats methods to handle removed cats/things

Benjamin Renard 2 years ago
parent
commit
801af67433
2 changed files with 10 additions and 1 deletions
  1. 1 1
      public_html/cache.manifest
  2. 9 0
      public_html/inc/mysc_objects.js

+ 1 - 1
public_html/cache.manifest

@@ -1,5 +1,5 @@
 CACHE MANIFEST
-# Date : 2017/09/17 - Version : 2
+# Date : 2018/06/18 - Version : 1
 
 CACHE:
 index.html

+ 9 - 0
public_html/inc/mysc_objects.js

@@ -245,8 +245,14 @@ function SCase(uuid,name,data) {
     var things=0;
     var things_done=0;
     this.cats.each(function(cidx,cat) {
+      if (cat.removed) {
+        return true;
+      }
       cats++;
       for (idx in cat.things) {
+        if (cat.things[idx].removed) {
+          continue;
+        }
         things++;
         if (cat.things[idx].checked) {
           things_done++;
@@ -472,6 +478,9 @@ function Cat(uuid,name,color,data) {
     var count=0;
     var done=0;
     for (idx in this.things) {
+      if (this.things[idx].removed) {
+        continue;
+      }
       if (this.things[idx].checked) {
         done+=1;
       }