Merge pull request #2108 from Safelite/Feature/Digital/CSR-2066

CSR-2066
This commit is contained in:
hiteshkumar87 2024-11-13 21:16:16 +05:30 committed by GitHub
commit 82729bb411
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,5 @@
<template> <template>
<Form <Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
@submit="onSubmit"
@invalid-submit="onInvalidSubmit"
ref="theForm"
v-slot="{ meta }"
id="insurance-company">
<loadingModal ref="loadingModal" /> <loadingModal ref="loadingModal" />
<div class="container-fluid page-container-grouped-styles"> <div class="container-fluid page-container-grouped-styles">
<div class="row justify-content-center"> <div class="row justify-content-center">
@ -111,10 +106,6 @@ export default {
: ""; : "";
return accountNumber; return accountNumber;
}, },
handleBeforeUnload() {
const insuranceCompanyPage = document.getElementById("insurance-company");
insuranceCompanyPage.parentElement.removeChild(insuranceCompanyPage);
},
arePagePrerequisitesValid() { arePagePrerequisitesValid() {
return store.getters.order.payment.isInsurance === true; return store.getters.order.payment.isInsurance === true;
}, },
@ -144,17 +135,20 @@ export default {
billToAccountNumber, billToAccountNumber,
false false
); );
//Manually unmount component in case navigate to external application. //Reload page when navigate with browser back button
window.addEventListener("beforeunload", this.handleBeforeUnload); window.addEventListener("pageshow", this.handlePageShow);
navigateToHeritageFunnel({ navigateToHeritageFunnel({
shouldSaveSession: true, shouldSaveSession: true,
pageNameToLog: "insurance-company", pageNameToLog: "insurance-company",
}); });
}, },
handlePageShow() {
window.location.reload();
},
}, },
unmounted() { unmounted() {
window.removeEventListener("beforeunload", this.handleBeforeUnload); window.removeEventListener("pageshow", this.handlePageShow);
}, },
components: { components: {
funnelHeader, funnelHeader,