diff --git a/frontend/app/javascript/dashboard/components/ChatList.vue b/frontend/app/javascript/dashboard/components/ChatList.vue index 3ba3435a..b7192ba4 100644 --- a/frontend/app/javascript/dashboard/components/ChatList.vue +++ b/frontend/app/javascript/dashboard/components/ChatList.vue @@ -797,6 +797,19 @@ onMounted(() => { } }); +// Fallback: if fetchAllConversations wasn't triggered during onMounted +// (e.g., race condition with route transition), retry after store settles. +// Uses a one-shot watch on conversationStats to detect empty state. +const _fallbackWatch = watch(conversationStats, (stats) => { + if (!stats) return; + const totalCount = (stats.mineCount || 0) + (stats.unAssignedCount || 0) + (stats.allCount || 0); + // If stats show conversations exist but chatList is empty, re-fetch + if (totalCount > 0 && chatLists.value.length === 0 && !chatListLoading.value) { + _fallbackWatch(); // unwatch immediately — one-shot + fetchConversations(); + } +}, { immediate: false }); + const deleteConversationDialogRef = ref(null); const selectedConversationId = ref(null); diff --git a/frontend/app/javascript/dashboard/components/copilot/CopilotContainer.vue b/frontend/app/javascript/dashboard/components/copilot/CopilotContainer.vue index 1cb915ea..33f63d8e 100644 --- a/frontend/app/javascript/dashboard/components/copilot/CopilotContainer.vue +++ b/frontend/app/javascript/dashboard/components/copilot/CopilotContainer.vue @@ -66,7 +66,10 @@ const activeAssistant = computed(() => { if (inboxMatchedAssistant) return inboxMatchedAssistant; } // If neither of the above is available, the first assistant in the account takes preference. - return assistants.value[0]; + if (assistants.value && assistants.value.length > 0) { + return assistants.value[0]; + } + return null; }); const closeCopilotPanel = () => { diff --git a/frontend/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationTable.vue b/frontend/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationTable.vue index 7f5d3ce2..d8b3559f 100644 --- a/frontend/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationTable.vue +++ b/frontend/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationTable.vue @@ -108,10 +108,10 @@ export default {