@mychoice/mychoice-sdk-modules 2.1.56 → 2.1.58
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 +19 -27
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +20 -28
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/init/StoryAppWrapper/StoryAppWrapper.d.ts +0 -3
- package/dist/cjs/init/StoryAppWrapper/index.d.ts +0 -1
- package/dist/cjs/init/StoryAppWrapper/interfaces.d.ts +0 -4
- package/dist/cjs/init/helper.d.ts +0 -2
- package/dist/cjs/insurances/car/pages/helpers.d.ts +0 -7
- package/dist/cjs/insurances/car/pages/quote/PageAllQuotes.d.ts +0 -2
- package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +0 -1
- package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +0 -2
- package/dist/cjs/insurances/home/pages/address/sections/blocks/BlockAddressInfo.d.ts +0 -2
- package/dist/cjs/insurances/home/pages/address/sections/blocks/index.d.ts +0 -1
- package/dist/cjs/insurances/home/pages/helpers.d.ts +0 -4
- package/dist/cjs/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +0 -3
- package/dist/cjs/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +0 -3
- package/dist/esm/init/StoryAppWrapper/StoryAppWrapper.d.ts +0 -3
- package/dist/esm/init/StoryAppWrapper/index.d.ts +0 -1
- package/dist/esm/init/StoryAppWrapper/interfaces.d.ts +0 -4
- package/dist/esm/init/helper.d.ts +0 -2
- package/dist/esm/insurances/car/pages/helpers.d.ts +0 -7
- package/dist/esm/insurances/car/pages/quote/PageAllQuotes.d.ts +0 -2
- package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +0 -1
- package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +0 -2
- package/dist/esm/insurances/home/pages/address/sections/blocks/BlockAddressInfo.d.ts +0 -2
- package/dist/esm/insurances/home/pages/address/sections/blocks/index.d.ts +0 -1
- package/dist/esm/insurances/home/pages/helpers.d.ts +0 -4
- package/dist/esm/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +0 -3
- package/dist/esm/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +0 -3
package/dist/cjs/index.js
CHANGED
|
@@ -206,7 +206,7 @@ const usePathGroups = (insuranceType) => {
|
|
|
206
206
|
const externalPathGroup = [
|
|
207
207
|
{ name: 'Car', link: 'https://quote.mychoice.ca/insurance/car' },
|
|
208
208
|
{ name: 'Home', link: 'https://quote.mychoice.ca/insurance/home' },
|
|
209
|
-
{ name: 'Life', link: 'https://
|
|
209
|
+
{ name: 'Life', link: 'https://quote.mychoice.ca/insurance/life' },
|
|
210
210
|
{ name: 'Learn', link: 'https://www.mychoice.ca/blog/' },
|
|
211
211
|
];
|
|
212
212
|
// @todo: use in future.
|
|
@@ -235,7 +235,7 @@ const HeaderMyChoice = ({ className, }) => {
|
|
|
235
235
|
? mychoiceSdkComponents.InsuranceTypes.Home
|
|
236
236
|
: insuranceType;
|
|
237
237
|
const { externalPathGroup } = usePathGroups(insuranceTypeCls);
|
|
238
|
-
return (jsxRuntime.jsx("div", { className: `${className} primary-header`, children: jsxRuntime.jsxs("div", { className: "content", children: [jsxRuntime.jsx("div", { className: "logo", children: jsxRuntime.jsx("a", { href: "https://www.mychoice.ca/", rel: "noreferrer", children: jsxRuntime.jsx("img", { src: logo, alt: "logotype" }) }) }), jsxRuntime.jsx("div", { className: "nav-links", children: jsxRuntime.jsx(mychoiceSdkComponents.HeaderNavGroup, { className: insuranceTypeCls, navItems: externalPathGroup }) }), jsxRuntime.jsx("div", { className: "empty-box" })] }) }));
|
|
238
|
+
return (jsxRuntime.jsx("div", { className: `${className} primary-header`, children: jsxRuntime.jsxs("div", { className: "content", children: [jsxRuntime.jsx("div", { className: "logo", children: jsxRuntime.jsx("a", { href: "https://www.mychoice.ca/", rel: "noreferrer", children: jsxRuntime.jsx("img", { src: logo, alt: "logotype" }) }) }), jsxRuntime.jsx("div", { className: "nav-links", children: jsxRuntime.jsx(mychoiceSdkComponents.HeaderNavGroup, { className: insuranceTypeCls, navItems: externalPathGroup, isExternal: true }) }), jsxRuntime.jsx("div", { className: "empty-box" })] }) }));
|
|
239
239
|
};
|
|
240
240
|
HeaderMyChoice.defaultProps = {
|
|
241
241
|
className: '',
|
|
@@ -315,8 +315,8 @@ const ModalMessage = () => {
|
|
|
315
315
|
const ModalPostal = () => {
|
|
316
316
|
const [inputValue, setInputValue] = React.useState('');
|
|
317
317
|
const insuranceType = mychoiceSdkComponents.getInsuranceType();
|
|
318
|
-
const { getPostal, status, errorMessage
|
|
319
|
-
const { appModalState: { title, submitButtonText, submitCallBack
|
|
318
|
+
const { getPostal, status, errorMessage } = mychoiceSdkStore.useHandlerPostal(insuranceType);
|
|
319
|
+
const { appModalState: { title, submitButtonText, submitCallBack }, } = mychoiceSdkStore.useStoreAppModal();
|
|
320
320
|
const loading = status === mychoiceSdkComponents.RequestStatusTypes.Loading;
|
|
321
321
|
const error = status === mychoiceSdkComponents.RequestStatusTypes.Error;
|
|
322
322
|
const onSubmit = (event) => {
|
|
@@ -2998,12 +2998,12 @@ const SectionCoverage = () => {
|
|
|
2998
2998
|
const { coverageState: { type, coverage, province, inValidation }, dispatchCoverageState, } = mychoiceSdkStore.useStoreFormLifeCoverage();
|
|
2999
2999
|
const { appConfigState: { appType }, } = mychoiceSdkStore.useStoreAppConfig();
|
|
3000
3000
|
const isMychoice = appType === mychoiceSdkComponents.AppTypes.MyChoice;
|
|
3001
|
-
const handleProvinceChange = ({ value }) => {
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
};
|
|
3001
|
+
// const handleProvinceChange = ({ value }: OnChangeEventInterface) => {
|
|
3002
|
+
// dispatchCoverageState({
|
|
3003
|
+
// type: StoreFormLifeCoverageActionTypes.FormLifeProvinceSelect,
|
|
3004
|
+
// payload: { province: value as string },
|
|
3005
|
+
// });
|
|
3006
|
+
// };
|
|
3007
3007
|
const handleLifeInsuranceTypeChange = ({ value }) => {
|
|
3008
3008
|
dispatchCoverageState({
|
|
3009
3009
|
type: mychoiceSdkStore.StoreFormLifeCoverageActionTypes.FormLifeCoverageTypeSelect,
|
|
@@ -3027,7 +3027,7 @@ const SectionCoverage = () => {
|
|
|
3027
3027
|
options: mychoiceSdkComponents.lifeInsuranceTypeOptions.filter((option) => option.name.includes('Year Level')),
|
|
3028
3028
|
};
|
|
3029
3029
|
}, [isMychoice, province]);
|
|
3030
|
-
return (jsxRuntime.jsxs("div", { className: "form-section", children: [jsxRuntime.jsx("h2", { className: "section-title", style: { textAlign: 'center' }, children: "Get the coverage you need" }), jsxRuntime.jsx(SelectFormBox, {
|
|
3030
|
+
return (jsxRuntime.jsxs("div", { className: "form-section", children: [jsxRuntime.jsx("h2", { className: "section-title", style: { textAlign: 'center' }, children: "Get the coverage you need" }), jsxRuntime.jsx(SelectFormBox, { ...newLifeOptions, name: "type", onChange: handleLifeInsuranceTypeChange, defaultValue: type, title: "Type of Insurance", description: jsxRuntime.jsx(Description, {}), placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !type && inValidation, errorMessage: getErrorMessage(type, inValidation) }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.lifeCoverageOptions, name: "coverage", onChange: handleCoverageChange, defaultValue: coverage, title: "Required coverage", description: "The extent of coverage you need is determined by several factors, including your expenditure patterns, anticipated future expenses, yearly earnings, and so forth. Generally, individuals opt for a coverage amount that equals five times their current annual income before taxes. On an average, it is observed that Canadians choose a coverage amount of around $500,000.", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !coverage && inValidation, errorMessage: getErrorMessage(coverage, inValidation) })] }));
|
|
3031
3031
|
};
|
|
3032
3032
|
|
|
3033
3033
|
const PageCoverage = () => {
|
|
@@ -3942,7 +3942,7 @@ const AppRouteWrapper = (props) => {
|
|
|
3942
3942
|
const { homeDiscountFormValidate, homeDiscountFormIsValid } = mychoiceSdkStore.useValidationHomeDiscount();
|
|
3943
3943
|
// life insurance validation
|
|
3944
3944
|
const { coverageFormValidate, coverageFormIsValid } = mychoiceSdkStore.useValidationCoverage();
|
|
3945
|
-
const { applicantFormValidate: lifeApplicantFormValidate, applicantFormIsValid: lifeApplicantFormIsValid
|
|
3945
|
+
const { applicantFormValidate: lifeApplicantFormValidate, applicantFormIsValid: lifeApplicantFormIsValid } = mychoiceSdkStore.useValidationLifeApplicant();
|
|
3946
3946
|
let postalCode = carPostal;
|
|
3947
3947
|
const { clearFormData, checkIsExpired, checkIsExpiredWithModal } = mychoiceSdkStore.ClearFormDataHandler();
|
|
3948
3948
|
const { appLoaderState } = mychoiceSdkStore.useStoreAppLoader();
|
|
@@ -4200,7 +4200,8 @@ const AppRouteWrapper = (props) => {
|
|
|
4200
4200
|
});
|
|
4201
4201
|
React.useEffect(() => {
|
|
4202
4202
|
if (isReady) {
|
|
4203
|
-
if (!carPostal && insuranceType === mychoiceSdkComponents.InsuranceTypes.Car)
|
|
4203
|
+
if ((!carPostal && insuranceType === mychoiceSdkComponents.InsuranceTypes.Car) ||
|
|
4204
|
+
(!lifePostal && insuranceType === mychoiceSdkComponents.InsuranceTypes.Life)) {
|
|
4204
4205
|
dispatchAppModalState({
|
|
4205
4206
|
type: mychoiceSdkStore.StoreConfigAppModalActionTypes.AppModalPostalModal,
|
|
4206
4207
|
payload: {
|
|
@@ -4210,12 +4211,7 @@ const AppRouteWrapper = (props) => {
|
|
|
4210
4211
|
}
|
|
4211
4212
|
}
|
|
4212
4213
|
}, [carPostal, homePostal, lifePostal, isReady]);
|
|
4213
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: isReady && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(AppHeader, {}), jsxRuntime.jsx(AppModal, {}), insuranceType && (jsxRuntime.jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted })), insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && (jsxRuntime.jsx("div", { className: localIndex !== mychoiceSdkComponents.defaultLocalIndex
|
|
4214
|
-
? 'step-progress-bar-partner'
|
|
4215
|
-
: 'step-progress-bar', children: jsxRuntime.jsx("span", { style: { width: progressLength } }) })), jsxRuntime.jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType &&
|
|
4216
|
-
appType === mychoiceSdkComponents.AppTypes.MyChoice &&
|
|
4217
|
-
isDesktop &&
|
|
4218
|
-
progressLength ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "mychoice-content", children: [jsxRuntime.jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsxRuntime.jsx("div", { className: "empty-steps-container" })] }) })) : (children) }), isMychoice && !appLoaderState.isOpen && jsxRuntime.jsx(ProviderImageFooter, {})] })) }));
|
|
4214
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: isReady && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(AppHeader, {}), jsxRuntime.jsx(AppModal, {}), insuranceType && (jsxRuntime.jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted })), insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && (jsxRuntime.jsx("div", { className: localIndex !== mychoiceSdkComponents.defaultLocalIndex ? 'step-progress-bar-partner' : 'step-progress-bar', children: jsxRuntime.jsx("span", { style: { width: progressLength } }) })), jsxRuntime.jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && isDesktop && progressLength ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "mychoice-content", children: [jsxRuntime.jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsxRuntime.jsx("div", { className: "empty-steps-container" })] }) })) : (children) }), isMychoice && !appLoaderState.isOpen && jsxRuntime.jsx(ProviderImageFooter, {})] })) }));
|
|
4219
4215
|
};
|
|
4220
4216
|
const NestedRoutes = () => {
|
|
4221
4217
|
const insuranceType = mychoiceSdkComponents.getInsuranceType();
|
|
@@ -4230,7 +4226,7 @@ const NestedRoutes = () => {
|
|
|
4230
4226
|
pathname: `/${appConfigState.localIndex || mychoiceSdkComponents.defaultLocalIndex}/${insuranceType}`,
|
|
4231
4227
|
} }) }), insuranceType === mychoiceSdkComponents.InsuranceTypes.Car && (jsxRuntime.jsxs(reactRouterDom.Route, { path: "car", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageVehicle, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "driver", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageDriver, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarDiscount, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarQuote, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "offer", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarQuote, {}) }) }) })] })), jsxRuntime.jsxs(reactRouterDom.Route, { path: "home", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageAddress, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageApplicant, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "property", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageProperty, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeDiscount, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeQuote, {}) }) }) })] }), jsxRuntime.jsxs(reactRouterDom.Route, { path: "condo", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageAddress, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageApplicant, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "property", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageProperty, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeDiscount, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeQuote, {}) }) }) })] }), jsxRuntime.jsxs(reactRouterDom.Route, { path: "tenant", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageAddress, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageApplicant, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "property", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageProperty, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeDiscount, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeQuote, {}) }) }) })] }), jsxRuntime.jsxs(reactRouterDom.Route, { path: "life", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Life, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCoverage, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Life, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageLifeApplicant, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Life, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageLifeQuote, {}) }) }) })] })] }) })) }));
|
|
4232
4228
|
};
|
|
4233
|
-
const RedirectWithSearchParams = ({ to, path
|
|
4229
|
+
const RedirectWithSearchParams = ({ to, path }) => {
|
|
4234
4230
|
const insuranceType = mychoiceSdkComponents.getInsuranceType();
|
|
4235
4231
|
const [isRender, setIsRender] = React.useState(false);
|
|
4236
4232
|
const { getPostal } = mychoiceSdkStore.useHandlerPostal(insuranceType);
|
|
@@ -4241,12 +4237,9 @@ const RedirectWithSearchParams = ({ to, path, }) => {
|
|
|
4241
4237
|
const toBasePath = to?.split('/')?.slice(-1)?.[0];
|
|
4242
4238
|
mychoiceSdkComponents.useEffectOnce(() => {
|
|
4243
4239
|
if (queryRoot.length > 1) {
|
|
4244
|
-
const query = JSON.parse(`{"${decodeURI(queryRoot[1])
|
|
4245
|
-
.replace(/"/g, '\\"')
|
|
4246
|
-
.replace(/&/g, '","')
|
|
4247
|
-
.replace(/=/g, '":"')}"}`);
|
|
4240
|
+
const query = JSON.parse(`{"${decodeURI(queryRoot[1]).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"')}"}`);
|
|
4248
4241
|
if (!isRender) {
|
|
4249
|
-
if (query.postal_code
|
|
4242
|
+
if (query.postal_code) {
|
|
4250
4243
|
const formattedPostalCode = query.postal_code.replace(' ', '');
|
|
4251
4244
|
getPostal(formattedPostalCode).then(() => {
|
|
4252
4245
|
setIsRender(true);
|
|
@@ -4290,8 +4283,7 @@ const RedirectWithSearchParams = ({ to, path, }) => {
|
|
|
4290
4283
|
payload: { utmCampaign: query.utm_campaign },
|
|
4291
4284
|
});
|
|
4292
4285
|
}
|
|
4293
|
-
if (path === 'broker' ||
|
|
4294
|
-
['home', 'condo', 'tenant'].includes(toBasePath)) {
|
|
4286
|
+
if (path === 'broker' || ['home', 'condo', 'tenant'].includes(toBasePath)) {
|
|
4295
4287
|
dispatchHomeDiscountState({
|
|
4296
4288
|
type: mychoiceSdkStore.StoreFormHomeDiscountActionTypes.FormHomeQuoterBrokerInfoSet,
|
|
4297
4289
|
payload: query,
|