@@ -131,7 +132,6 @@ import TimeManager from '~/utils/time'
import { stripMarkdownLength } from '~/utils/markdown'
import SearchPersonDropdown from '~/components/SearchPersonDropdown.vue'
import BasePlaceholder from '~/components/BasePlaceholder.vue'
-import BaseTabs from '~/components/BaseTabs.vue'
const config = useRuntimeConfig()
const conversations = ref([])
@@ -146,24 +146,13 @@ const { fetchUnreadCount: refreshGlobalUnreadCount } = useUnreadCount()
const { fetchChannelUnread: refreshChannelUnread, setFromList: setChannelUnreadFromList } =
useChannelsUnreadCount()
let subscription = null
-const tabs = [
- { name: 'messages', label: '站内信' },
- { name: 'channels', label: '频道' },
-]
+
const activeTab = ref('channels')
const channels = ref([])
const loadingChannels = ref(false)
const isFloatMode = computed(() => route.query.float === '1')
const floatRoute = useState('messageFloatRoute')
-watch(activeTab, (tab) => {
- if (tab === 'messages') {
- fetchConversations()
- } else {
- fetchChannels()
- }
-})
-
async function fetchConversations() {
const token = getToken()
if (!token) {
@@ -227,6 +216,16 @@ async function fetchChannels() {
}
}
+function switchToMessage() {
+ activeTab.value = 'messages'
+ fetchConversations()
+}
+
+function switchToChannels() {
+ activeTab.value = 'channels'
+ fetchChannels()
+}
+
async function goToChannel(id) {
const token = getToken()
if (!token) {
diff --git a/frontend_nuxt/pages/message.vue b/frontend_nuxt/pages/message.vue
index 8496e2ccc..d694b1b2d 100644
--- a/frontend_nuxt/pages/message.vue
+++ b/frontend_nuxt/pages/message.vue
@@ -1,13 +1,26 @@