fix a bug in primaries (#6567)

This commit is contained in:
Cassie Levett
2020-05-25 09:52:23 -04:00
committed by GitHub
parent e1986cdc50
commit 0fb7dab0b8
3 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -55,18 +55,18 @@ const updateRepeatingPrimary = (eventinfo, type) => {
if (eventinfo.newValue === undefined) {
return false
} else if (eventinfo.newValue === 'primary') {
const constructedAttributes = type === 'armor' ? shadowrunFunctions.addRepRow(repRowID, sheetAttributes.armorAttributes) : shadowrunFunctions.contructRepeatingWeaponAttributes(repRowID, type);
const constructedAttributes = type === 'armor' ? processingFunctions.shadowrun.addRepRow(repRowID, sheetAttributes.armorAttributes) : processingFunctions.shadowrun.contructRepeatingWeaponAttributes(repRowID, type);
//get the attributes to update primary
getAttrs(constructedAttributes, attrs => {
const update = type === 'armor' ? shadowrunFunctions.updatePrimaryArmor(attrs) : shadowrunFunctions.updatePrimaryWeapons(attrs);
const update = type === 'armor' ? processingFunctions.shadowrun.updatePrimaryArmor(attrs) : processingFunctions.shadowrun.updatePrimaryWeapons(attrs);
processingFunctions.setAttributes(update)
})
//Reset all the other primaries
shadowrunFunctions.resetRepeatingFieldsPrimaries(`repeating_${type}`, repRowID)
processingFunctions.shadowrun.resetRepeatingFieldsPrimaries(`repeating_${type}`, repRowID)
} else {
const update = type === 'armor' ? shadowrunFunctions.resetPrimaryArmor() : shadowrunFunctions.resetPrimaryWeapon(type);
const update = type === 'armor' ? processingFunctions.shadowrun.resetPrimaryArmor() : processingFunctions.shadowrun.resetPrimaryWeapon(type);
processingFunctions.setAttributes(update)
}
}