single API requests before recieving the data
This commit is contained in:
@@ -179,8 +179,8 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
players (): { [key: string]: Player } {
|
||||
const data = this.store.getPlayerList(this.filters || {})?.data
|
||||
if (!data) return {}
|
||||
const data = this.store.getPlayerList(this.filters || {})?.value.data
|
||||
if (!data) return this.store.fetchPlayers(this.filters || {}).value.data
|
||||
const cut = Object.entries(data).sort((a, b) => {
|
||||
if (a[1].kills < b[1].kills) {
|
||||
return 1
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -137,11 +137,8 @@ export default defineComponent({
|
||||
},
|
||||
weapons (): { [key: string]: Weapon } {
|
||||
const { weapon: _, ...withoutWeapon } = this.filters || {}
|
||||
const data = this.store.getWeaponList(withoutWeapon)?.data
|
||||
if (!data) {
|
||||
this.store.fetchWeapons(withoutWeapon)
|
||||
return {}
|
||||
}
|
||||
const data = this.store.getWeaponList(withoutWeapon)?.value.data
|
||||
if (!data) return this.store.fetchWeapons(withoutWeapon).value.data
|
||||
return data
|
||||
},
|
||||
sortedWeaponList (): string[] {
|
||||
|
||||
Reference in New Issue
Block a user