15
15
</div >
16
16
<div class =" ticket__lower" >
17
17
<div class =" ticket__message" >
18
- {{ beauty(ticket.message ) }}
18
+ {{ beauty(ticket) }}
19
19
</div >
20
20
<div class =" ticket__time" >
21
21
{{ toDate(ticket.date / 1000 || ticket.date, ".", "00:00") }}
@@ -31,6 +31,7 @@ import { useRoute, useRouter } from "vue-router";
31
31
import { useChatsStore } from " @/stores/chats.js" ;
32
32
import { toDate } from " @/functions.js" ;
33
33
import config from " @/appconfig.js" ;
34
+ import { useI18n } from " vue-i18n" ;
34
35
35
36
const props = defineProps ({
36
37
ticket: { type: Object , required: true },
@@ -41,6 +42,7 @@ const props = defineProps({
41
42
const router = useRouter ();
42
43
const route = useRoute ();
43
44
const chatsStore = useChatsStore ();
45
+ const { t } = useI18n ();
44
46
45
47
const offset = computed (() => {
46
48
if (props .ticket .unread > 9 ) {
@@ -82,13 +84,16 @@ function ticketClick(id) {
82
84
router .push ({ path: ` /ticket/${ id} ` , query });
83
85
}
84
86
85
- function beauty (message ) {
87
+ function beauty (ticket ) {
88
+ let message = ticket .message ;
86
89
message = decode (message);
87
90
message = message .replace (/ -{2,} . * / gi , " " );
88
91
message = message .replace (/ IP Address. * / gi , " " );
89
92
message = message .replace (/ <\/ ? [a-zA-Zа-яА-Я1-9 #-: =";_!?] + >/ gi , " " );
90
93
91
- return message .trim () || " empty" ;
94
+ return message .trim () || ticket .attachments ? .length > 0
95
+ ? t (" attachedFiles" )
96
+ : " empty" ;
92
97
}
93
98
94
99
function decode (text ) {
0 commit comments