added tick_rate + condition to display chat
All checks were successful
CSGOWTF/csgowtf/pipeline/head This commit looks good
All checks were successful
CSGOWTF/csgowtf/pipeline/head This commit looks good
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="chat-history mt-2">
|
||||
<table class="table table-borderless">
|
||||
<table v-if="data.chat.length > 0" class="table table-borderless">
|
||||
<tbody>
|
||||
<tr v-for="(m, id) in data.chat" :key="id">
|
||||
<td>
|
||||
{{ ConvertTickToTime(m.tick) }}
|
||||
{{ ConvertTickToTime(m.tick, m.tick_rate) }}
|
||||
</td>
|
||||
<td class="td-avatar">
|
||||
<img :class="'team-color-' + m.color"
|
||||
@@ -41,6 +41,9 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div v-else>
|
||||
<h3 class="text-center">No chat available</h3>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -60,10 +63,9 @@ export default {
|
||||
|
||||
const getChatHistory = async () => {
|
||||
const resData = await GetChatHistory(store, store.state.matchDetails.match_id)
|
||||
if (resData !== null) {
|
||||
if (resData !== null)
|
||||
data.chat = await setPlayer(sortChatHistory(resData))
|
||||
}
|
||||
}
|
||||
|
||||
const sortChatHistory = (res = {}) => {
|
||||
let arr = []
|
||||
@@ -85,7 +87,6 @@ export default {
|
||||
}
|
||||
|
||||
const setPlayer = async (chat) => {
|
||||
console.log(store.state.matchDetails)
|
||||
let arr = []
|
||||
for (const o of chat) {
|
||||
for (const p of store.state.matchDetails.stats) {
|
||||
@@ -102,6 +103,7 @@ export default {
|
||||
game_ban: p.player.game_ban,
|
||||
game_ban_date: p.player.game_ban_date,
|
||||
tick: o.tick,
|
||||
tick_rate: store.state.matchDetails.tick_rate !== -1 ? store.state.matchDetails.tick_rate : 64,
|
||||
all_chat: o.all_chat,
|
||||
message: o.message
|
||||
})
|
||||
|
@@ -129,9 +129,9 @@
|
||||
replace>Damage
|
||||
</router-link>
|
||||
</li>
|
||||
<li :title="!data.matchDetails.parsed ? 'This demo has not been parsed' : data.matchDetails.date < 1643410799 ? 'This feature wasn\'t available for this match' : ''"
|
||||
<li :title="!data.matchDetails.parsed ? 'This demo has not been parsed' : ''"
|
||||
class="list-item nav-item">
|
||||
<router-link :class="!data.matchDetails.parsed ? 'disabled' : data.matchDetails.date < 1643410799 ? 'disabled' : ''" :disabled="!data.matchDetails.parsed"
|
||||
<router-link :class="!data.matchDetails.parsed ? 'disabled' : ''" :disabled="!data.matchDetails.parsed"
|
||||
:to="'/match/' + data.matchDetails.match_id + '/chat'" class="nav-link"
|
||||
replace>Chat
|
||||
</router-link>
|
||||
@@ -257,12 +257,8 @@ export default {
|
||||
if (route.fullPath.split('/')[3]) {
|
||||
const sub = route.fullPath.split('/')[3]
|
||||
if (matchIdPattern.test(props.match_id)) {
|
||||
if (store.state.matchDetails.date <= 1643410799 && sub === 'chat') {
|
||||
GoToLink(`/match/${props.match_id}`)
|
||||
} else
|
||||
GoToLink(`/match/${props.match_id}/${sub}`)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
errorHandling(404)
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user