From a69894e0fcdd0decbbcabc707160a085e2dbbd9b Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 15 May 2024 20:52:08 -0700 Subject: [PATCH] Reset data --- .../dashboard/store/modules/reports.js | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app/javascript/dashboard/store/modules/reports.js b/app/javascript/dashboard/store/modules/reports.js index a31b9b283..12e150ca4 100644 --- a/app/javascript/dashboard/store/modules/reports.js +++ b/app/javascript/dashboard/store/modules/reports.js @@ -7,6 +7,17 @@ import { REPORTS_EVENTS } from '../../helper/AnalyticsHelper/events'; import { clampDataBetweenTimeline } from 'shared/helpers/ReportsDataHelper'; import liveReports from '../../api/liveReports'; +const accountSummaryInitialData = { + avg_first_response_time: 0, + avg_resolution_time: 0, + conversations_count: 0, + incoming_messages_count: 0, + outgoing_messages_count: 0, + reply_time: 0, + resolutions_count: 0, + previous: {}, +}; + const state = { fetchingStatus: false, accountReport: { @@ -29,16 +40,7 @@ const state = { reply_time: [], }, }, - accountSummary: { - avg_first_response_time: 0, - avg_resolution_time: 0, - conversations_count: 0, - incoming_messages_count: 0, - outgoing_messages_count: 0, - reply_time: 0, - resolutions_count: 0, - previous: {}, - }, + accountSummary: accountSummaryInitialData, overview: { uiFlags: { isFetchingAccountConversationMetric: false, @@ -108,6 +110,7 @@ export const actions = { }); }, fetchAccountSummary({ commit }, reportObj) { + commit(types.default.SET_ACCOUNT_SUMMARY, accountSummaryInitialData); Report.getSummary( reportObj.from, reportObj.to,