Moved from store to pageData Added bailoutMessage const update setBailout method to accept currentPage or to/from types
22 lines
593 B
JavaScript
22 lines
593 B
JavaScript
import { useMainStore } from '@/store';
|
|
import BailoutCode from '@/constants/bailoutCode';
|
|
import issPageValues from "@/router/router-constants/issPage-values";
|
|
|
|
function canBailoutNavigateBack() {
|
|
const code = useMainStore().pageData(issPageValues.BAILOUT_PAGE)?.bailoutCode;
|
|
if (code == null) {
|
|
return true;
|
|
}
|
|
|
|
switch (code) {
|
|
case BailoutCode.VehicleNotFound:
|
|
case BailoutCode.DoNotSeeMyShop:
|
|
case BailoutCode.TPANotEnabled:
|
|
return true;
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export default canBailoutNavigateBack;
|