fixed title showing internal bsp name instead of actual map name + added reset-mutations to store

This commit is contained in:
cnachtigall1991
2021-10-19 07:56:37 +02:00
parent 2c25138516
commit bb3da7d3c4
4 changed files with 35 additions and 8 deletions

View File

@@ -90,6 +90,7 @@ import axios from 'axios'
import {DisplayRank, FormatFullDate, GetAvgRank, GoToLink, LoadImage} from "../utils";
import {useStore} from "vuex";
import {useRoute} from 'vue-router'
import {MAPNAMES} from "../constants";
export default {
name: 'Match',
@@ -102,7 +103,7 @@ export default {
// Refs
const data = reactive({
playerName: '',
player_id: '',
matchDetails: {},
stats: [],
score: [0],
@@ -116,7 +117,7 @@ export default {
.get(`${process.env.VUE_APP_API_URL}/match/${props.match_id}`)
.then((response) => {
if (response.data.map)
document.title = `${response.data.map} | csgoWTF`
document.title = `${MAPNAMES[response.data.map]} | csgoWTF`
else
document.title = `Match-Details | csgoWTF`
@@ -177,10 +178,7 @@ export default {
})
onBeforeUnmount(() => {
store.commit({
type: 'changeMatchDetails',
data: {}
})
store.commit('resetMatchDetails')
})
return {