From 928ae3a2580e7d4d73040fa6944e7dbdc28df6ca Mon Sep 17 00:00:00 2001 From: Ashish Deo Date: Thu, 20 Mar 2025 18:29:39 +0530 Subject: [PATCH] NTP-47793 | Bug fix (#1399) --- src/pages/AllAgents/AgentForm/AgentForm.tsx | 1 - src/pages/AllAgents/index.tsx | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/AllAgents/AgentForm/AgentForm.tsx b/src/pages/AllAgents/AgentForm/AgentForm.tsx index 4d9c694a..39607be5 100644 --- a/src/pages/AllAgents/AgentForm/AgentForm.tsx +++ b/src/pages/AllAgents/AgentForm/AgentForm.tsx @@ -115,7 +115,6 @@ export const AgentForm = forwardRef((props: AgentFormProps, ref) => { }; useEffect(() => { - dispatch(getAgentPreferences()); dispatch(getBucketGroup()); dispatch(getAvailableRoles()); dispatch(getIsEmailMandatoryForAgencyCode()); diff --git a/src/pages/AllAgents/index.tsx b/src/pages/AllAgents/index.tsx index 1b9a977d..402ee04e 100644 --- a/src/pages/AllAgents/index.tsx +++ b/src/pages/AllAgents/index.tsx @@ -36,6 +36,7 @@ import { GenericObject } from '@cp/src/types/CommonConstans'; import { useColumnDefs } from './UploadHistory/ColumnDefs'; import { fetchUploadHistoryPolling } from './UploadHistory/actions/uploadHistoryDrawerActions'; import { Roles } from '../auth/constants/AuthConstants'; +import { getAgentPreferences } from './AgentForm/actions/agentFormActions'; export const getQueryString = () => { const queryParams = readQueryParams(); @@ -140,6 +141,10 @@ const AllAgents = () => { dispatch(setAgentRefId(data?.referenceId)); }; + useEffect(() => { + dispatch(getAgentPreferences()); + }, []); + useEffect(() => { isDrawerOpen ? window.addEventListener('beforeunload', handleTabClose)