fix(web): guard empty channel list in watch to prevent crash

The immediate watcher on configuredChannels accessed list[0].meta.type
without checking if the list was empty, causing a TypeError on initial
mount before data loaded. This crashed the component during setup and
corrupted KeepAlive state, making all bot detail tabs unresponsive.

Made-with: Cursor
This commit is contained in:
Fodesu
2026-03-25 01:53:04 +08:00
committed by 晨苒
parent dd1b588e95
commit 3a7f5200ed
@@ -201,6 +201,8 @@ const selectedItem = computed(() =>
)
watch(configuredChannels, (list) => {
if (list.length === 0) return
const first = list[0]
if (first && !selectedType.value) {
selectedType.value = first.meta.type ?? null