@mychoice/mychoice-sdk-modules 2.1.18 → 2.1.19

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/cjs/index.js CHANGED
@@ -155,7 +155,7 @@ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, is
155
155
  const isTheBig = appType === mychoiceSdkComponents.AppTypes.TheBig;
156
156
  const mychoiceCls = appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : '';
157
157
  const { weekdayHours, saturdayHours, sundayHours } = operationHours;
158
- const [detailsIsOpen, setDetailsIsOpenIsOpen] = React.useState(false);
158
+ const [detailsIsOpen, setDetailsIsOpenIsOpen] = React.useState(isBestOffer ?? false);
159
159
  const handleDropdownClick = () => {
160
160
  setDetailsIsOpenIsOpen(!detailsIsOpen);
161
161
  };
@@ -255,9 +255,7 @@ jsxRuntime.jsx("video", { src: "https://mychoice.ca/wp-content/uploads/2023/05/P
255
255
  const LoaderPrimary = () => {
256
256
  const { appLoaderState } = mychoiceSdkStore.useStoreAppLoader();
257
257
  const { appConfigState } = mychoiceSdkStore.useStoreAppConfig();
258
- console.log(window.location.pathname);
259
258
  const isLastPage = window.location.pathname.includes('discount') || window.location.pathname.includes('applicant');
260
- console.log(isLastPage);
261
259
  return (jsxRuntime.jsxs("div", { className: "loader-wrapper", children: [appConfigState.appType === mychoiceSdkComponents.AppTypes.TheBig || !isLastPage ? jsxRuntime.jsx(mychoiceSdkComponents.IconLoaderPrimary, {}) : jsxRuntime.jsx(LoaderVid, {}), !!appLoaderState.description && (jsxRuntime.jsx("h4", { children: appLoaderState.description.split('\n').map((line, index) => (jsxRuntime.jsxs("div", { children: [line, jsxRuntime.jsx("br", {})] }, index))) }))] }));
262
260
  };
263
261
 
@@ -4017,6 +4015,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4017
4015
  const { dispatchDiscountState: dispatchHomeDiscountState } = mychoiceSdkStore.useStoreFormHomeDiscount();
4018
4016
  const { dispatchApplicantState: dispatchLifeApplicantState } = mychoiceSdkStore.useStoreFormLifeApplicant();
4019
4017
  const queryRoot = reactRouterDom.useLocation().search.split('?');
4018
+ const toBasePath = to?.split('/')?.slice(-1)?.[0];
4020
4019
  mychoiceSdkComponents.useEffectOnce(() => {
4021
4020
  if (queryRoot.length > 1) {
4022
4021
  const query = JSON.parse(`{"${decodeURI(queryRoot[1]).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"')}"}`);
@@ -4043,7 +4042,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4043
4042
  payload: { utmCampaign: query.utm_campaign },
4044
4043
  });
4045
4044
  }
4046
- if (path === 'broker') {
4045
+ if (path === 'broker' || toBasePath === 'car') {
4047
4046
  dispatchCarDiscountState({
4048
4047
  type: mychoiceSdkStore.StoreFormCarDiscountActionTypes.FormCarDiscountQuoterBrokerInfoSet,
4049
4048
  payload: query,
@@ -4063,7 +4062,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4063
4062
  payload: { utmCampaign: query.utm_campaign },
4064
4063
  });
4065
4064
  }
4066
- if (path === 'broker') {
4065
+ if (path === 'broker' || ['home', 'condo', 'tenant'].includes(toBasePath)) {
4067
4066
  dispatchHomeDiscountState({
4068
4067
  type: mychoiceSdkStore.StoreFormHomeDiscountActionTypes.FormHomeQuoterBrokerInfoSet,
4069
4068
  payload: query,