bugfix: fix sorting of players by score in highscore table

This commit is contained in:
Settel 2022-09-25 18:05:56 +02:00
parent 5c2b99a909
commit 376a9f5642

View File

@ -20,13 +20,17 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue'
import { usePlayersStore } from '@/stores/PlayersStore' import { usePlayersStore } from '@/stores/PlayersStore'
import { useGameinfoStore } from "@/stores/GameinfoStore" import { useGameinfoStore } from "@/stores/GameinfoStore"
const title = useGameinfoStore().gameInfo.name const title = useGameinfoStore().gameInfo.name
const players = usePlayersStore().players const players = computed(() => {
players.sort((a, b) => { const p = usePlayersStore().players
return b.score - a.score p.sort((a, b) => {
return b.score - a.score
})
return p
}) })
</script> </script>