fix: remove inbox keep-alive that caused duplicate admin requests

This commit is contained in:
Abhinav Raut
2026-06-01 13:06:52 +05:30
parent b42c46f890
commit 97df3ba7a6
2 changed files with 15 additions and 8 deletions
+1 -5
View File
@@ -112,11 +112,7 @@
<PageHeader />
<!-- Main content -->
<RouterView v-slot="{ Component }">
<keep-alive include="InboxLayout">
<component :is="Component" class="flex-grow" />
</keep-alive>
</RouterView>
<RouterView class="flex-grow" />
</div>
<ViewForm v-model:openDialog="openCreateViewForm" v-model:view="view" />
</Sidebar>
@@ -20,6 +20,15 @@ const conversationStore = useConversationStore()
let lastFetchedKey = ''
const storeHasCurrentList = () => {
const c = conversationStore.conversations
if (!c.initialized) return false
if (viewID.value) return c.listType === CONVERSATION_LIST_TYPE.VIEW && String(c.viewID) === String(viewID.value)
if (type.value) return c.listType === type.value
if (teamID.value) return c.listType === CONVERSATION_LIST_TYPE.TEAM_UNASSIGNED && String(c.teamID) === String(teamID.value)
return false
}
const fetchForCurrentRoute = () => {
if (!type.value && !teamID.value && !viewID.value) return
@@ -27,9 +36,11 @@ const fetchForCurrentRoute = () => {
if (key === lastFetchedKey) return
lastFetchedKey = key
const showLoader = !storeHasCurrentList()
if (viewID.value) {
conversationStore.setListStatus('', false)
conversationStore.fetchConversationsList(true, CONVERSATION_LIST_TYPE.VIEW, 0, [], viewID.value)
conversationStore.fetchConversationsList(showLoader, CONVERSATION_LIST_TYPE.VIEW, 0, [], viewID.value)
return
}
@@ -37,9 +48,9 @@ const fetchForCurrentRoute = () => {
conversationStore.setListStatus(CONVERSATION_DEFAULT_STATUSES.OPEN, false)
}
if (type.value) {
conversationStore.fetchConversationsList(true, type.value)
conversationStore.fetchConversationsList(showLoader, type.value)
} else {
conversationStore.fetchConversationsList(true, CONVERSATION_LIST_TYPE.TEAM_UNASSIGNED, teamID.value)
conversationStore.fetchConversationsList(showLoader, CONVERSATION_LIST_TYPE.TEAM_UNASSIGNED, teamID.value)
}
}