Reset values when the dialog is closed
The way we handle state means that we will keep old, unsaved values around if we don't do this
This commit is contained in:
parent
0b21bf768a
commit
15aa61731c
2 changed files with 13 additions and 2 deletions
|
|
@ -249,6 +249,19 @@ const CharacterModal = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
|
setEarring({
|
||||||
|
modifier: gridCharacter.aetherial_mastery
|
||||||
|
? gridCharacter.aetherial_mastery.modifier
|
||||||
|
: 0,
|
||||||
|
strength: gridCharacter.aetherial_mastery
|
||||||
|
? gridCharacter.aetherial_mastery.strength
|
||||||
|
: 0,
|
||||||
|
})
|
||||||
|
|
||||||
|
setRings(gridCharacter.over_mastery || emptyExtendedMastery)
|
||||||
|
setAwakening(gridCharacter.awakening.type)
|
||||||
|
setAwakeningLevel(gridCharacter.awakening.level)
|
||||||
|
|
||||||
setAlertOpen(false)
|
setAlertOpen(false)
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
onOpenChange(false)
|
onOpenChange(false)
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,6 @@ const AwakeningSelectWithInput = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methods: Handle error
|
// Methods: Handle error
|
||||||
|
|
||||||
function handleInputError(value: number) {
|
function handleInputError(value: number) {
|
||||||
let error = ''
|
let error = ''
|
||||||
|
|
||||||
|
|
@ -211,7 +210,6 @@ const AwakeningSelectWithInput = ({
|
||||||
max={maxLevel}
|
max={maxLevel}
|
||||||
step="1"
|
step="1"
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
visible={awakening ? 'true' : 'false'}
|
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue