mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user