Merge pull request #642 from Safelite/feature/allow-blank-page-data
Add empty object for pageData by default
This commit is contained in:
commit
e7af5bd738
1 changed files with 3 additions and 4 deletions
|
|
@ -159,10 +159,9 @@ async function navigate(scenario, currentRoute, optionalQuery = {}, optionalPara
|
|||
if (destinationFmgPageValue !== undefined) {
|
||||
// We're always pushing the same path, just changing query strings. Make sure our optional query strings get combined with our fmgPage one.
|
||||
|
||||
// Update page data to the store for next page if provided. Otherwise, keep existing page data
|
||||
if (optionalPageData !== undefined) {
|
||||
baseMixin.methods.savePageDataToStore(destinationFmgPageValue, optionalPageData);
|
||||
}
|
||||
// Update page data to the store for next page if provided. Otherwise, keep existing page data or set to empty object
|
||||
const existingPageDataForPage = store.getters.pageData(destinationFmgPageValue);
|
||||
baseMixin.methods.savePageDataToStore(destinationFmgPageValue, optionalPageData ? optionalPageData : existingPageDataForPage ?? {});
|
||||
|
||||
// if cookie and referralNumber/Date exists OR an emailAddress has been saved
|
||||
if ((getFunnelCookie()?.ReferralNumber && getFunnelCookie()?.ReferralDate) || store.getters.order.customer?.emailAddress) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue