This commit is contained in:
2026-07-30 19:34:39 +02:00
parent 1bb00e1edf
commit 086e5ab0ea
7 changed files with 71 additions and 4 deletions
+5 -1
View File
@@ -6,6 +6,7 @@ import {ref, watch} from 'vue'
import {useRoute} from 'vue-router'
import CreateChannelDialog from '@/components/channel/CreateChannelDialog.vue'
import {type MenuItem, useContextMenu} from '@/composables/useContextMenu'
import {useUserStore} from "@/stores/user.ts";
const props = defineProps<{
serverId: string
@@ -15,6 +16,7 @@ const props = defineProps<{
const route = useRoute()
const channelStore = useChannelStore()
const categoryStore = useCategoryStore()
const userStore = useUserStore()
const {channels} = storeToRefs(channelStore)
const {categories} = storeToRefs(categoryStore)
const {openContextMenu} = useContextMenu()
@@ -24,10 +26,12 @@ const loadServerData = async (targetServerId: string) => {
if (!targetServerId) return
channelStore.reset()
categoryStore.reset()
userStore.reset()
try {
await Promise.all([
channelStore.fetchChannels(targetServerId),
categoryStore.fetchCategories(targetServerId)
categoryStore.fetchCategories(targetServerId),
userStore.fetchUsers(targetServerId)
])
} catch (error) {
console.error('Failed to load server-scoped channels and categories:', error)