feat: improve DMs for structured messages

This commit is contained in:
Vlad Stan 2023-07-03 17:17:08 +03:00
parent 2b84ebc83b
commit 13b19b672e
2 changed files with 60 additions and 71 deletions

View file

@ -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: [],