fixed title showing internal bsp name instead of actual map name + added reset-mutations to store
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
export const MAPNAMES = {
|
||||
'cs_agency': 'Agency',
|
||||
'cs_insetion2': 'Insertion II',
|
||||
'cs_office': 'Office',
|
||||
'de_ancient': 'Ancient',
|
||||
'de_basalt': 'Basalt',
|
||||
'de_cache': 'Cache',
|
||||
'de_dust2': 'Dust II',
|
||||
'de_inferno': 'Inferno',
|
||||
'de_mirage': 'Mirage',
|
||||
'de_nuke': 'Nuke',
|
||||
'de_overpass': 'Overpass',
|
||||
'de_train': 'Train',
|
||||
'de_vertigo': 'Vertigo',
|
||||
}
|
||||
|
||||
export const HITGROUPS = {
|
||||
0: 'HitGroupGeneric',
|
||||
1: 'HitGroupHead',
|
||||
|
@@ -20,6 +20,18 @@ export default createStore({
|
||||
changePlayerDetails(state, payload) {
|
||||
state.playerDetails = payload.data
|
||||
},
|
||||
resetId64(state) {
|
||||
state.id64 = ''
|
||||
},
|
||||
resetVanityUrl(state) {
|
||||
state.vanityUrl = ''
|
||||
},
|
||||
resetMatchDetails(state) {
|
||||
state.matchDetails = ''
|
||||
},
|
||||
resetPlayerDetails(state) {
|
||||
state.playerDetails = ''
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
|
@@ -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 {
|
||||
|
@@ -378,9 +378,10 @@ export default {
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
store.commit({
|
||||
type: 'changePlayerDetails',
|
||||
data: {}
|
||||
type: 'changeId64',
|
||||
data: store.state.playerDetails.steamid64
|
||||
})
|
||||
store.commit('resetPlayerDetails')
|
||||
})
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user