2023-09-12 15:52:16 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
|
|
|
|
|
|
import {saveSettingsToFile} from '../js/settingsHandler';
|
|
|
|
|
|
|
|
import { setActivePinia } from 'pinia';
|
|
|
|
import pinia from '../store/index';
|
|
|
|
setActivePinia(pinia);
|
|
|
|
|
|
|
|
import { useSettingsStore } from '../store/settingsStore.js';
|
|
|
|
const settings = useSettingsStore(pinia);
|
|
|
|
|
|
|
|
import { useStateStore } from '../store/stateStore.js';
|
|
|
|
const state = useStateStore(pinia);
|
|
|
|
|
|
|
|
import { useChatStore } from '../store/chatStore.js';
|
|
|
|
const chat = useChatStore(pinia);
|
|
|
|
|
2023-09-13 21:28:20 +00:00
|
|
|
import SentMessage from './chat_messages_sent.vue'; // Import the chat_messages_sent component
|
|
|
|
import ReceivedMessage from './chat_messages_received.vue'; // Import the chat_messages_sent component
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-12 15:52:16 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="tab-content" id="nav-tabContent-chat-messages">
|
2023-09-12 20:49:41 +00:00
|
|
|
<template v-for="callsign in chat.callsign_list">
|
|
|
|
|
|
|
|
|
2023-09-13 21:28:20 +00:00
|
|
|
<div class="tab-pane fade" :id="`list-${callsign}-messages`" role="tabpanel" :aria-labelledby="`list-chat-list-${callsign}`">
|
|
|
|
|
2023-09-12 20:49:41 +00:00
|
|
|
|
|
|
|
<template v-for="item in chat.sorted_chat_list[callsign]" :key="item._id">
|
2023-09-13 21:28:20 +00:00
|
|
|
<div v-if="item.type === 'transmit'">
|
|
|
|
<!--Sending message: {{ item.msg }} -->
|
|
|
|
<sent-message :message="item" />
|
|
|
|
</div>
|
|
|
|
<div v-else-if="item.type === 'received'">
|
|
|
|
<!--Received message: {{ item.msg }}-->
|
|
|
|
<received-message :message="item" />
|
|
|
|
|
|
|
|
</div>
|
2023-09-12 20:49:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-13 21:28:20 +00:00
|
|
|
</template>
|
2023-09-12 20:49:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
2023-09-12 15:52:16 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</template>
|