2024-02-16 16:20:18 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import FormChat from "@/modules/00_support/components/FormChat.vue";
|
2024-02-16 16:20:18 +07:00
|
|
|
import { useSupportStore } from "@/modules/00_support/store/Main";
|
2024-02-16 16:20:19 +07:00
|
|
|
import { storeToRefs } from "pinia";
|
2024-02-16 16:20:18 +07:00
|
|
|
import { onMounted, onUnmounted, ref } from "vue";
|
|
|
|
|
const store = useSupportStore();
|
2024-02-16 16:20:19 +07:00
|
|
|
const { currentIssue } = storeToRefs(store);
|
2024-02-16 16:20:18 +07:00
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
store.socket.connect();
|
2024-02-16 16:20:19 +07:00
|
|
|
if (currentIssue.value) {
|
|
|
|
|
store.socket.emit("join-issue", { issueId: currentIssue.value });
|
|
|
|
|
store.socket.emit("mark-read", { issueId: currentIssue.value });
|
|
|
|
|
}
|
2024-02-16 16:20:18 +07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onUnmounted(async () => {
|
|
|
|
|
store.socket.disconnect();
|
|
|
|
|
});
|
2024-02-16 16:20:18 +07:00
|
|
|
</script>
|
2024-01-29 11:11:08 +07:00
|
|
|
|
|
|
|
|
<template>
|
2024-02-16 16:20:19 +07:00
|
|
|
<form-chat />
|
2024-01-29 11:11:08 +07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|