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)