Skip to content

Commit 76bb47c

Browse files
committed
add attached files logick
1 parent c38d9f9 commit 76bb47c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/components/support/ticketItem.vue

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</div>
1616
<div class="ticket__lower">
1717
<div class="ticket__message">
18-
{{ beauty(ticket.message) }}
18+
{{ beauty(ticket) }}
1919
</div>
2020
<div class="ticket__time">
2121
{{ toDate(ticket.date / 1000 || ticket.date, ".", "00:00") }}
@@ -31,6 +31,7 @@ import { useRoute, useRouter } from "vue-router";
3131
import { useChatsStore } from "@/stores/chats.js";
3232
import { toDate } from "@/functions.js";
3333
import config from "@/appconfig.js";
34+
import { useI18n } from "vue-i18n";
3435
3536
const props = defineProps({
3637
ticket: { type: Object, required: true },
@@ -41,6 +42,7 @@ const props = defineProps({
4142
const router = useRouter();
4243
const route = useRoute();
4344
const chatsStore = useChatsStore();
45+
const { t } = useI18n();
4446
4547
const offset = computed(() => {
4648
if (props.ticket.unread > 9) {
@@ -82,13 +84,16 @@ function ticketClick(id) {
8284
router.push({ path: `/ticket/${id}`, query });
8385
}
8486
85-
function beauty(message) {
87+
function beauty(ticket) {
88+
let message = ticket.message;
8689
message = decode(message);
8790
message = message.replace(/-{2,}.*/gi, "");
8891
message = message.replace(/IP Address.*/gi, "");
8992
message = message.replace(/<\/?[a-zA-Zа-яА-Я1-9 #-:=";_!?]+>/gi, "");
9093
91-
return message.trim() || "empty";
94+
return message.trim() || ticket.attachments?.length > 0
95+
? t("attachedFiles")
96+
: "empty";
9297
}
9398
9499
function decode(text) {

src/routes/services/servicePage.vue

+1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ async function onStart() {
349349
);
350350
351351
domain.resources = {
352+
...products,
352353
period: t("PayG"),
353354
recurringamount: 0,
354355
inputKilotoken: products.input_kilotoken,

0 commit comments

Comments
 (0)