fix crash when removing ability in build modal

This commit is contained in:
Kalle (Sendou)
2020-11-28 13:22:28 +02:00
parent 0fc12227cf
commit 643bb16550
2 changed files with 3 additions and 3 deletions

View File

@@ -220,7 +220,7 @@ const BuildCard: React.FC<BuildCardProps & BoxProps> = ({
<Box>
<Box>
{build.modes.map((mode) => (
<Box as="span" mr={1}>
<Box key={mode} as="span" mr={1}>
<ModeImage mode={mode} size={24} />
</Box>
))}

View File

@@ -196,9 +196,9 @@ const BuildModal: React.FC<Props> = ({ onClose, build }) => {
shoesAbilities: onShoesChange,
};
const newAbilityArray = {
const newAbilityArray = [
...abilityArrays[gear],
};
];
newAbilityArray[index] = "UNKNOWN";
onChange[gear](newAbilityArray);