feat: show message timestamp
This commit is contained in:
parent
acc6ed45c5
commit
b6b86f5a02
2 changed files with 4 additions and 0 deletions
|
|
@ -16,16 +16,19 @@ async function directMessages(path) {
|
|||
computed: {
|
||||
messagesAsJson: function () {
|
||||
return this.messages.map(m => {
|
||||
const dateFrom = moment(m.event_created_at * 1000).fromNow()
|
||||
try {
|
||||
const message = JSON.parse(m.message)
|
||||
return {
|
||||
isJson: message.type >= 0,
|
||||
dateFrom,
|
||||
...m,
|
||||
message
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
isJson: false,
|
||||
dateFrom,
|
||||
...m,
|
||||
message: m.message
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue