@mychoice/mychoice-sdk-store 2.1.46 → 2.1.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -5565,7 +5565,9 @@ const LifeQuoteDataHandler = () => {
5565
5565
  const { appConfigState } = useStoreAppConfig();
5566
5566
  const navigate = useNavigate();
5567
5567
  const { checkIsExpired, checkIsExpiredWithModal } = ClearFormDataHandler();
5568
- const [requestState, setRequestState] = useReducer(dataHandlerReducer, { ...initialHandlerRequestState });
5568
+ const [requestState, setRequestState] = useReducer(dataHandlerReducer, {
5569
+ ...initialHandlerRequestState,
5570
+ });
5569
5571
  const { status, successMessage, responseData, errorMessage, isFirstRequest, responseError, } = requestState;
5570
5572
  const { cancelToken } = useCancelToken();
5571
5573
  const openLoader = (loaderDescription = '') => {
@@ -5603,7 +5605,7 @@ const LifeQuoteDataHandler = () => {
5603
5605
  first_name: applicant.quoterInfo?.firstName,
5604
5606
  last_name: applicant.quoterInfo?.lastName,
5605
5607
  phone: Number(applicant.quoterInfo?.phone),
5606
- recalculate: false,
5608
+ recalculate: quoteState?.items?.length > 0,
5607
5609
  utm_source: applicant.quoterInfo?.utmSource,
5608
5610
  utm_campaign: applicant.quoterInfo?.utmCampaign,
5609
5611
  },
@@ -5636,6 +5638,7 @@ const LifeQuoteDataHandler = () => {
5636
5638
  else {
5637
5639
  openLoader('Please wait while we fetch your lowest rates from our insurance partners.');
5638
5640
  }
5641
+ console.log('isRecalc', isRecalc, quoteState);
5639
5642
  const requestBody = constructRequestBody(); // isRecalc is removed in life insurance
5640
5643
  if (requestBody) {
5641
5644
  try {
@@ -5663,7 +5666,9 @@ const LifeQuoteDataHandler = () => {
5663
5666
  setRequestState({
5664
5667
  type: DataHandlerActionTypes.SetSuccess,
5665
5668
  });
5666
- dispatchAppLoaderState({ type: StoreConfigAppLoaderActionTypes.AppLoaderClose });
5669
+ dispatchAppLoaderState({
5670
+ type: StoreConfigAppLoaderActionTypes.AppLoaderClose,
5671
+ });
5667
5672
  if (!isRecalc) {
5668
5673
  navigate(`/${appConfigState.localIndex}/life/quotes`);
5669
5674
  }
@@ -5673,12 +5678,14 @@ const LifeQuoteDataHandler = () => {
5673
5678
  type: DataHandlerActionTypes.SetError,
5674
5679
  payload: 'Axios request error',
5675
5680
  });
5676
- dispatchAppLoaderState({ type: StoreConfigAppLoaderActionTypes.AppLoaderClose });
5681
+ dispatchAppLoaderState({
5682
+ type: StoreConfigAppLoaderActionTypes.AppLoaderClose,
5683
+ });
5677
5684
  }
5678
5685
  }
5679
5686
  }
5680
5687
  };
5681
- return ({
5688
+ return {
5682
5689
  status,
5683
5690
  successMessage,
5684
5691
  responseData,
@@ -5687,7 +5694,7 @@ const LifeQuoteDataHandler = () => {
5687
5694
  responseError,
5688
5695
  postRequestQuote,
5689
5696
  postRequestQuoteOnliaUrl: () => { },
5690
- });
5697
+ };
5691
5698
  };
5692
5699
 
5693
5700
  const useValidationVehicle = () => {