Browse Source

bug fix: revisions mismatch

bach 1 month ago
parent
commit
0fae2dee66
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/components/ConcernementMapItem.vue

+ 7 - 0
src/components/ConcernementMapItem.vue

@@ -409,7 +409,14 @@ export default {
 
       // console.log(`ConcernementsMapItem ${this.id} created`);
       // this.entites = this.concernement.entites
+      // TODO sometimes active revision is not on revisions_by_id ... why ?
+      let revisions_ids = Object.keys(this.concernement.revisions_byid);
+      if (revisions_ids.indexOf(this.concernement.revision_id) !== -1) {
       this.entites = this.concernement.revisions_byid[this.concernement.revision_id].entites;
+      } else {
+        this.entites = this.concernement.revisions_byid[revisions_ids.pop()].entites;
+      }
+      
     },
     parseEntityPointsValues (){
       // console.log(`parseEntityPointsValues`);