This commit is contained in:
2026-08-08 20:55:01 +02:00
parent 8f3fd6a127
commit 93800e8460
5 changed files with 80 additions and 9 deletions
+12 -1
View File
@@ -2,7 +2,7 @@
import {storeToRefs} from 'pinia'
import {useChannelStore} from '@/stores/channel'
import {useCategoryStore} from '@/stores/category'
import {computed, ref, watch} from 'vue'
import {computed, onMounted, onUnmounted, ref, watch} from 'vue'
import {useRoute} from 'vue-router'
import CreateChannelDialog from '@/components/channel/CreateChannelDialog.vue'
import CreateCategoryDialog from '@/components/category/CreateCategoryDialog.vue'
@@ -12,6 +12,7 @@ import {useServerStore} from "@/stores/server.ts";
import ChannelPermissionsDialog from '@/components/permissions/ChannelPermissionsDialog.vue'
import {useAuthStore} from '@/stores/auth'
import ServerSettingsDialog from '@/components/server/ServerSettingsDialog.vue'
import {onReloadAll} from '@/plugins/events.ts'
const props = defineProps<{
serverId: string
@@ -48,6 +49,16 @@ const loadServerData = async (targetServerId: string) => {
}
}
let stopReloadAll: (() => void) | null = null
onMounted(() => {
stopReloadAll = onReloadAll(() => loadServerData(props.serverId))
})
onUnmounted(() => {
stopReloadAll?.()
})
watch(
() => props.serverId,
async (newServerId) => {