diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js index 49a12fc87c2..97269753012 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js @@ -381,10 +381,10 @@ const SetupCampaign = () => { useEffect(() => { setTimeout(() => { setEnabled(fetchUpload || (fetchBoundary && currentKey > 6)); - },3000); - + }, 3000); + // return () => clearTimeout(timeoutId); - }, [fetchUpload,fetchBoundary,currentKey]); + }, [fetchUpload, fetchBoundary, currentKey]); const { data: facilityId, isLoading: isFacilityLoading, refetch: refetchFacility } = Digit.Hooks.campaign.useGenerateIdCampaign({ type: "facilityWithBoundary", @@ -393,9 +393,9 @@ const SetupCampaign = () => { // config: { // enabled: setTimeout(fetchUpload || (fetchBoundary && currentKey > 6)), // }, - config:{ - enabled: enabled - } + config: { + enabled: enabled, + }, }); // useEffect(() => { @@ -412,9 +412,9 @@ const SetupCampaign = () => { // config: { // enabled: fetchUpload || (fetchBoundary && currentKey > 6), // }, - config:{ - enabled: enabled - } + config: { + enabled: enabled, + }, }); const { data: userId, isLoading: isUserLoading, refetch: refetchUser } = Digit.Hooks.campaign.useGenerateIdCampaign({ @@ -424,9 +424,9 @@ const SetupCampaign = () => { // config: { // enabled: fetchUpload || (fetchBoundary && currentKey > 6), // }, - config:{ - enabled: enabled - } + config: { + enabled: enabled, + }, }); useEffect(() => { @@ -732,6 +732,8 @@ const SetupCampaign = () => { } }, }); + } else { + setCurrentKey(currentKey + 1); } };