CASH-462 | Utilize new constant in the store

This commit is contained in:
Scott Kiener 2025-04-03 14:23:09 -04:00
parent af9775aa3b
commit fe666f381a

View file

@ -1,6 +1,7 @@
import { createStore } from "vuex";
import { endpoints } from "@/constants/endpoints.js";
import { storeMutations } from "@/constants/store-mutations";
import { sessionStorageKeyConstants } from "@/constants/session-storage.js";
import { getDateForSavedSessionTimeout } from "@/helpers/heritage-integration/session-helper";
import createPersistedState from "vuex-persistedstate";
import globalMethods from "@/global-methods";
@ -822,8 +823,8 @@ export const getters = {
},
coverageIsVerified: (state) => {
let order;
if (window.sessionStorage.getItem("submittedState") !== null) {
order = JSON.parse(window.sessionStorage.getItem("submittedState")).order;
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
order = JSON.parse(window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE)).order;
} else {
order = state.order;
}
@ -851,9 +852,9 @@ export const getters = {
return getHasRecalibrationPart(state);
},
isRecalibrationOnSubmittedState: (state) => {
if (window.sessionStorage.getItem("submittedState") !== null) {
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
return getHasRecalibrationPart({
order: JSON.parse(window.sessionStorage.getItem("submittedState")).order,
order: JSON.parse(window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE)).order,
});
}
@ -861,8 +862,8 @@ export const getters = {
},
shouldHideRecalibration: (state) => {
var order;
if (window.sessionStorage.getItem("submittedState") !== null) {
order = JSON.parse(window.sessionStorage.getItem("submittedState")).order;
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
order = JSON.parse(window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE)).order;
} else {
order = state.order;
}
@ -3258,7 +3259,7 @@ export const actions = {
},
createSubmittedState(context) {
if (window.sessionStorage.getItem("submittedState") !== null) {
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
return;
}
@ -3272,7 +3273,7 @@ export const actions = {
const affiliateCookies = context.state.applicationUser.affiliateCookies;
// set to local storage
window.sessionStorage.setItem("submittedState", JSON.stringify(submittedState));
window.sessionStorage.setItem(sessionStorageKeyConstants.SUBMITTED_STATE, JSON.stringify(submittedState));
window.sessionStorage.setItem("createNewSessionForHeritage", true);
// clear vuex
@ -3330,12 +3331,12 @@ export const actions = {
applicationUser: submittedApplicationUser,
};
// set to local storage
window.sessionStorage.setItem("submittedState", JSON.stringify(submittedState));
window.sessionStorage.setItem(sessionStorageKeyConstants.SUBMITTED_STATE, JSON.stringify(submittedState));
},
resetSubmittedState(context) {
// clear from local storage
window.sessionStorage.removeItem("submittedState");
window.sessionStorage.removeItem(sessionStorageKeyConstants.SUBMITTED_STATE);
},
resetExternalParameterState(context) {
if (context.getters.isExternalParameter) {