feat: improve DMs for structured messages
This commit is contained in:
parent
2b84ebc83b
commit
13b19b672e
2 changed files with 60 additions and 71 deletions
|
|
@ -13,6 +13,25 @@ async function directMessages(path) {
|
|||
await this.getDirectMessages(n)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
messagesAsJson: function() {
|
||||
return this.messages.map(m => {
|
||||
try {
|
||||
return {
|
||||
isJson: true,
|
||||
...m,
|
||||
message: JSON.parse(m.message)
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
isJson: false,
|
||||
...m,
|
||||
message: m.message
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
customers: [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue