single API requests before recieving the data

This commit is contained in:
2023-04-28 16:18:52 +02:00
parent 0be6adb7d2
commit dd075d2982
5 changed files with 80 additions and 63 deletions
+3 -1
View File
@@ -46,7 +46,9 @@ export default defineComponent({
computed: {
players (): { [key: string]: Player } {
const { player: _, ...withoutPlayer } = this.filters
return this.store.getPlayerList(withoutPlayer)?.data || {}
const data = this.store.getPlayerList(withoutPlayer)?.value.data
if (!data) return this.store.fetchPlayers(withoutPlayer).value.data
return data
}
},
watch: {