Przeglądaj źródła

fix: Fixed a critical bug that overwrites other weapons if modifying one

Warafear 11 miesięcy temu
rodzic
commit
1cdc6ddb8c

+ 5 - 1
src/app/journal/journal-stats/weapons-container/weapon-table/weapon-table.component.ts

@@ -125,7 +125,8 @@ export class WeaponTableComponent {
           this.deleteWeapon(index);
         } else if (result.state === 'update') {
           this.openModal(true, index);
-        } else resultSubscription.unsubscribe();
+        }
+        resultSubscription.unsubscribe();
       },
     );
   }
@@ -151,6 +152,9 @@ export class WeaponTableComponent {
   }
 
   public updateWeapon(weapon: Weapon, index: number): void {
+    console.warn('updateWeapon: ', weapon);
+    console.warn('index: ', index);
+
     this.weapons[index] = weapon;
     this.calculateSingleDamageModifier(index);
     this.updateWeaponInDatabase();