Small bug fix
This commit is contained in:
parent
f817a806a3
commit
398be02486
@ -27,8 +27,12 @@ export const useZoneStore = defineStore('zone', {
|
|||||||
this.characters = this.characters.filter((c: Character) => c.id !== character.id)
|
this.characters = this.characters.filter((c: Character) => c.id !== character.id)
|
||||||
},
|
},
|
||||||
updateCharacter(character: Character) {
|
updateCharacter(character: Character) {
|
||||||
const index = this.characters.findIndex((c: Character) => c.id === character.id)
|
const index = this.characters.findIndex((c) => c.id === character.id)
|
||||||
this.characters[index] = character
|
if (index !== -1) {
|
||||||
|
this.characters[index] = character
|
||||||
|
} else {
|
||||||
|
console.error(`Character with id ${character.id} not found`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user