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