diff --git a/src/components/PageNewCharacter/StepAbilities/StepAbilities.tsx b/src/components/PageNewCharacter/StepAbilities/StepAbilities.tsx index 03a24e4e..f8215161 100644 --- a/src/components/PageNewCharacter/StepAbilities/StepAbilities.tsx +++ b/src/components/PageNewCharacter/StepAbilities/StepAbilities.tsx @@ -11,11 +11,12 @@ interface StepAbilitiesProps { setComboClass?: (comboClass: boolean) => void; setComboClassSwitch?: (comboClassSwitch: boolean) => void; hideRollAll?: boolean; + newCharacter?: boolean; } const StepAbilities: React.FC< StepAbilitiesProps & React.ComponentPropsWithRef<"div"> -> = ({ className, character, setCharacter, hideRollAll }) => { +> = ({ className, character, setCharacter, hideRollAll, newCharacter }) => { const dataSource = [ { key: "1", @@ -104,22 +105,32 @@ const StepAbilities: React.FC< scores: Record, modifiers: Record, ) => { - setCharacter({ - ...character, - abilities: { - scores: { ...character.abilities?.scores, ...scores }, - modifiers: { ...character.abilities?.modifiers, ...modifiers }, - }, - class: [], - race: "", - hp: { - dice: "", - points: 0, - max: 0, - desc: "", - }, - equipment: [], - }); + if (newCharacter) { + setCharacter({ + ...character, + abilities: { + scores: { ...character.abilities?.scores, ...scores }, + modifiers: { ...character.abilities?.modifiers, ...modifiers }, + }, + class: [], + race: "", + hp: { + dice: "", + points: 0, + max: 0, + desc: "", + }, + equipment: [], + }); + } else { + setCharacter({ + ...character, + abilities: { + scores: { ...character.abilities?.scores, ...scores }, + modifiers: { ...character.abilities?.modifiers, ...modifiers }, + }, + }); + } }; const rollAllAbilities = () => { diff --git a/src/components/PageNewCharacter/StepHitPoints/StepHitPoints.tsx b/src/components/PageNewCharacter/StepHitPoints/StepHitPoints.tsx index 7b8c4051..cd122a6e 100644 --- a/src/components/PageNewCharacter/StepHitPoints/StepHitPoints.tsx +++ b/src/components/PageNewCharacter/StepHitPoints/StepHitPoints.tsx @@ -29,6 +29,9 @@ const StepHitPoints: React.FC< roll = roll < 1 ? 1 : roll; setMax(roll); }; + const handleInputChange = (value: number | null) => { + if (value) setMax(value); + }; const onSelectChange = (value: DiceTypes) => { setDie(value); }; @@ -55,7 +58,7 @@ const StepHitPoints: React.FC<