diff --git a/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue b/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue index 6b321c55d..cb5cfcb5b 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/ConversationView.vue @@ -15,6 +15,14 @@ export default { PopOverSearch, CmdBarConversationSnooze, }, + beforeRouteLeave(to, from, next) { + // Clear selected state if navigating away from a conversation to a route without a conversationId to prevent stale data issues + // and resolves timing issues during navigation with conversation view and other screens + if (this.conversationId) { + this.$store.dispatch('clearSelectedState'); + } + next(); // Continue with navigation + }, props: { inboxId: { type: [String, Number],