From 0e628a485041c5f13d4ddcc2e2849ed5e6e8313b Mon Sep 17 00:00:00 2001 From: Katie Date: Thu, 29 Sep 2022 15:25:01 -0400 Subject: [PATCH] CSR-762 Make sure gaState isn't persisted --- .../base-input-button/base-input-button.vue | 16 +++------------- src/store/index.js | 7 ++++++- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/common-components/base-input-button/base-input-button.vue b/src/common-components/base-input-button/base-input-button.vue index d3574fef2..225363401 100644 --- a/src/common-components/base-input-button/base-input-button.vue +++ b/src/common-components/base-input-button/base-input-button.vue @@ -90,7 +90,7 @@ export default { this.groupName, false ); - // window.lastFocusedInputGroup = this.groupName; + this.pushClickEventToGA(); break; } @@ -126,17 +126,14 @@ export default { this.valueToEmit = this.value; } - // window.currentlySelectedValues = - // window.currentlySelectedValues ?? {}; this.dispatchStoreAction( gaStoreActions.UPDATE_CURRENTLY_SELECTED_VALUES, { groupName: this.groupName, value: this.value, }, - // false ); - // window.currentlySelectedValues[this.groupName] = this.value; + this.handleChange(this.valueToEmit); }, handleClick(e) { @@ -144,8 +141,6 @@ export default { this.$emit("buttonClicked", this.valueToEmit); }, pushClickEventToGA(value) { - // window.firedGaClickEventValues = - // window.firedGaClickEventValues ?? {}; const lastFocusedInputGroup = store.getters.gaClickInformation.lastFocusedInputGroup; this.dispatchStoreAction( @@ -154,10 +149,7 @@ export default { groupName: lastFocusedInputGroup, value: value ?? this.value, }, - // false ); - // window.firedGaClickEventValues[window.lastFocusedInputGroup] = - // value ?? this.value; this.pushEventToGA( this.$route.query[queryStrings.FMG_PAGE], @@ -178,8 +170,6 @@ export default { this.isMultiSelect, false ); - // window.lastFocusedInputGroup = this.groupName; - // window.wasLastFocusedInputMultiselect = this.isMultiSelect; }, handleKeyboardNavigation(key) { this.test(key); @@ -223,7 +213,7 @@ export default { this.groupName, false ); - // window.lastFocusedInputGroup = this.groupName; + if ( firedGaClickEventValues[lastFocusedInputGroup] != currentlySelectedValues[lastFocusedInputGroup] diff --git a/src/store/index.js b/src/store/index.js index 34bba86c0..cd2122ba9 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1398,7 +1398,12 @@ export const actions = { // }); export default createStore({ - plugins: [createPersistedState()], + plugins: [createPersistedState({ + reducer: state => { + const { gaState, ...rest } = state + return rest + } + })], modules: { gaState, },