CASH-462 | Utilize new constant in the store
This commit is contained in:
parent
af9775aa3b
commit
fe666f381a
1 changed files with 11 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { createStore } from "vuex";
|
import { createStore } from "vuex";
|
||||||
import { endpoints } from "@/constants/endpoints.js";
|
import { endpoints } from "@/constants/endpoints.js";
|
||||||
import { storeMutations } from "@/constants/store-mutations";
|
import { storeMutations } from "@/constants/store-mutations";
|
||||||
|
import { sessionStorageKeyConstants } from "@/constants/session-storage.js";
|
||||||
import { getDateForSavedSessionTimeout } from "@/helpers/heritage-integration/session-helper";
|
import { getDateForSavedSessionTimeout } from "@/helpers/heritage-integration/session-helper";
|
||||||
import createPersistedState from "vuex-persistedstate";
|
import createPersistedState from "vuex-persistedstate";
|
||||||
import globalMethods from "@/global-methods";
|
import globalMethods from "@/global-methods";
|
||||||
|
|
@ -822,8 +823,8 @@ export const getters = {
|
||||||
},
|
},
|
||||||
coverageIsVerified: (state) => {
|
coverageIsVerified: (state) => {
|
||||||
let order;
|
let order;
|
||||||
if (window.sessionStorage.getItem("submittedState") !== null) {
|
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
||||||
order = JSON.parse(window.sessionStorage.getItem("submittedState")).order;
|
order = JSON.parse(window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE)).order;
|
||||||
} else {
|
} else {
|
||||||
order = state.order;
|
order = state.order;
|
||||||
}
|
}
|
||||||
|
|
@ -851,9 +852,9 @@ export const getters = {
|
||||||
return getHasRecalibrationPart(state);
|
return getHasRecalibrationPart(state);
|
||||||
},
|
},
|
||||||
isRecalibrationOnSubmittedState: (state) => {
|
isRecalibrationOnSubmittedState: (state) => {
|
||||||
if (window.sessionStorage.getItem("submittedState") !== null) {
|
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
||||||
return getHasRecalibrationPart({
|
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) => {
|
shouldHideRecalibration: (state) => {
|
||||||
var order;
|
var order;
|
||||||
if (window.sessionStorage.getItem("submittedState") !== null) {
|
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
||||||
order = JSON.parse(window.sessionStorage.getItem("submittedState")).order;
|
order = JSON.parse(window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE)).order;
|
||||||
} else {
|
} else {
|
||||||
order = state.order;
|
order = state.order;
|
||||||
}
|
}
|
||||||
|
|
@ -3258,7 +3259,7 @@ export const actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
createSubmittedState(context) {
|
createSubmittedState(context) {
|
||||||
if (window.sessionStorage.getItem("submittedState") !== null) {
|
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3272,7 +3273,7 @@ export const actions = {
|
||||||
const affiliateCookies = context.state.applicationUser.affiliateCookies;
|
const affiliateCookies = context.state.applicationUser.affiliateCookies;
|
||||||
|
|
||||||
// set to local storage
|
// 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);
|
window.sessionStorage.setItem("createNewSessionForHeritage", true);
|
||||||
|
|
||||||
// clear vuex
|
// clear vuex
|
||||||
|
|
@ -3330,12 +3331,12 @@ export const actions = {
|
||||||
applicationUser: submittedApplicationUser,
|
applicationUser: submittedApplicationUser,
|
||||||
};
|
};
|
||||||
// set to local storage
|
// set to local storage
|
||||||
window.sessionStorage.setItem("submittedState", JSON.stringify(submittedState));
|
window.sessionStorage.setItem(sessionStorageKeyConstants.SUBMITTED_STATE, JSON.stringify(submittedState));
|
||||||
},
|
},
|
||||||
|
|
||||||
resetSubmittedState(context) {
|
resetSubmittedState(context) {
|
||||||
// clear from local storage
|
// clear from local storage
|
||||||
window.sessionStorage.removeItem("submittedState");
|
window.sessionStorage.removeItem(sessionStorageKeyConstants.SUBMITTED_STATE);
|
||||||
},
|
},
|
||||||
resetExternalParameterState(context) {
|
resetExternalParameterState(context) {
|
||||||
if (context.getters.isExternalParameter) {
|
if (context.getters.isExternalParameter) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue