From 4c20a977e6cb5bf54ffe3cfd60c0c17563617120 Mon Sep 17 00:00:00 2001 From: Katie Date: Thu, 28 Jul 2022 10:52:52 -0400 Subject: [PATCH 1/2] CSR-702 Don't default page data to empty object --- src/router/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index e0c5d537b..26c884c59 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -163,7 +163,7 @@ router.navigateToExternalUrl = (url, optionalQuery = {}) => { // PRIVATE FUNCTIONS // Navigate to the next route, depending on the scenario. -async function navigate(scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData = {}) { +async function navigate(scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData) { if (!scenario) { console.error("No scenario provided. Please review the routing table."); return; @@ -176,9 +176,8 @@ 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, use existing page data or override with empty object - const existingPageData = store.getters.pageData(destinationFmgPageValue) ?? {}; - if (Object.keys(optionalPageData).length > 0 && Object.keys(existingPageData).length === 0) { + // Update page data to the store for next page if provided. Otherwise, keep existing page data + if (optionalPageData !== undefined) { baseMixin.methods.savePageDataToStore(destinationFmgPageValue, optionalPageData); } From afdcb4824280738a0fae454c7ecb11fc64bf01ae Mon Sep 17 00:00:00 2001 From: Katie Date: Thu, 28 Jul 2022 11:27:15 -0400 Subject: [PATCH 2/2] CSR-702 Remove default for optionalPageData in router.navigate --- src/router/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 26c884c59..767b9ab18 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -151,7 +151,7 @@ router.afterEach((to, from) => { }); -router.navigate = (scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData = {}) => { +router.navigate = (scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData) => { navigate(scenario, currentRoute, optionalQuery, optionalParams, optionalPageData); }