Browse Source

try new fix

tripeur 4 years ago
parent
commit
fdb865f450
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/Timeline.ts

+ 2 - 3
src/Timeline.ts

@@ -229,8 +229,7 @@ class Timeline extends LitElement {
     updateRessource<K extends keyof Ressource>(id:string,key:K,value:Ressource[K]):void{
         const ressource = this.getRessourceFromId(id);
         if(ressource){
-        
-        if (key == "parent") {
+          if (key == "parent") {
             const content = this.removeRessourceById(id);
             ressource[key] = value;
             this.addRessource(ressource)
@@ -238,7 +237,7 @@ class Timeline extends LitElement {
             this.addEvents(content.items);
           } else {
             ressource[key] = value;
-            this.rows.splice(this.rows.findIndex(r=>r.id==ressource.id), 1, ressource);
+            this.rows[this.rows.findIndex(r=>r.id==ressource.id)] =  ressource;
           }
         }
     }