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,9 +63,8 @@ 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 = {}) => {
|
||||
@@ -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
|
||||
})
|
||||
|
Reference in New Issue
Block a user