Try to fix object error
This commit is contained in:
parent
90dcb54bba
commit
c39b66bce2
1 changed files with 5 additions and 2 deletions
|
|
@ -231,7 +231,9 @@ const CharacterGrid = (props: Props) => {
|
||||||
)
|
)
|
||||||
|
|
||||||
const updateUncapLevel = (position: number, uncapLevel: number) => {
|
const updateUncapLevel = (position: number, uncapLevel: number) => {
|
||||||
appState.grid.characters[position].uncap_level = uncapLevel
|
if (grid.characters[position]) {
|
||||||
|
appState.grid.characters[position]!.uncap_level = uncapLevel
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function storePreviousUncapValue(position: number) {
|
function storePreviousUncapValue(position: number) {
|
||||||
|
|
@ -239,7 +241,8 @@ const CharacterGrid = (props: Props) => {
|
||||||
let newPreviousValues = { ...previousUncapValues }
|
let newPreviousValues = { ...previousUncapValues }
|
||||||
|
|
||||||
if (grid.characters[position]) {
|
if (grid.characters[position]) {
|
||||||
newPreviousValues[position] = grid.characters[position].uncap_level
|
const character = grid.characters[position]
|
||||||
|
newPreviousValues[position] = character ? character.uncap_level : -1
|
||||||
setPreviousUncapValues(newPreviousValues)
|
setPreviousUncapValues(newPreviousValues)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue