1
0
forked from noxious/client

Minor improvement

This commit is contained in:
2024-09-29 16:07:55 +02:00
parent df3b9db45d
commit 1f46b94441
3 changed files with 57 additions and 51 deletions

View File

@ -2,11 +2,13 @@ import { defineStore } from 'pinia'
import type { ExtendedCharacter, Zone } from '@/types'
export const useZoneStore = defineStore('zone', {
state: () => ({
zone: null as Zone | null,
characters: [] as ExtendedCharacter[],
characterLoaded: false
}),
state: () => {
return {
zone: null as Zone | null,
characters: [] as ExtendedCharacter[],
characterLoaded: false
}
},
getters: {
getCharacterById: (state) => {
return (id: number) => state.characters.find((char) => char.id === id)