Chatwoot/app/javascript/shared/mixins/messageFormatterMixin.js
Sojan Jose b0950d6880
Feature: Rich Message Types (#610)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
2020-04-10 16:42:37 +05:30

17 lines
414 B
JavaScript

import MessageFormatter from '../helpers/MessageFormatter';
export default {
methods: {
formatMessage(message) {
const messageFormatter = new MessageFormatter(message);
return messageFormatter.formattedMessage;
},
truncateMessage(description = '') {
if (description.length < 100) {
return description;
}
return `${description.slice(0, 97)}...`;
},
},
};