Adding parameter to indicate whether save session should be synchronous
This commit is contained in:
parent
9118d59878
commit
8bbd7afb77
2 changed files with 8 additions and 3 deletions
|
|
@ -17,6 +17,7 @@ import applicationConfig from '@/constants/application-config';
|
|||
import analyticsMixin from '@/mixins/analytics-mixin';
|
||||
import navigationScenarios from './router-constants/navigation-scenarios';
|
||||
import { saveSession } from "@/helpers/order-helper.js";
|
||||
import routerParams from '@/router/router-constants/router-params';
|
||||
|
||||
const routes = [
|
||||
{
|
||||
|
|
@ -93,9 +94,12 @@ router.afterEach(async (to, from) => {
|
|||
store.clearSaveSessionPromise();
|
||||
}
|
||||
|
||||
await saveSession({shouldAwaitSaveSessionQueue: true}).catch((error) => {
|
||||
const saveSessionSynchronous = !!from.params[routerParams.SAVE_SESSION_SYNCHRONOUS];
|
||||
await saveSession({shouldAwaitSaveSessionQueue: saveSessionSynchronous}).catch((error) => {
|
||||
if (from.name === issPageValues.WELCOME_PAGE) {
|
||||
router.navigate(navigationScenarios.SAVE_SESSION_FAILED, {query: {issPage: issPageValues.WELCOME_PAGE}})
|
||||
router.navigate(
|
||||
navigationScenarios.SAVE_SESSION_FAILED,
|
||||
{query: {issPage: issPageValues.WELCOME_PAGE}});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
const routerParams = Object.freeze({
|
||||
DISPLAY_VEHICLE_CHANGE_ALERT: 'displayVehicleChangeAlert'
|
||||
DISPLAY_VEHICLE_CHANGE_ALERT: 'displayVehicleChangeAlert',
|
||||
SAVE_SESSION_SYNCHRONOUS: 'saveSessionSynchronous'
|
||||
});
|
||||
|
||||
export default routerParams;
|
||||
|
|
|
|||
Loading…
Reference in a new issue