Some more guarding.

This commit is contained in:
Jeremy-Z 2026-07-07 15:56:29 -04:00
parent c338c12f1c
commit c6def1fd8a

View file

@ -138,23 +138,32 @@ export default {
async forwardButtonAction() {
showIssLoadingModal(true);
// If user clicked foward without selecting an option or user click on "start a new claim" button.
if (this.selectedAnswer == null || this.selectedAnswer === 'NewClaim') {
// Call SaveSession to create referral.
await saveSession({ shouldAwaitSaveSessionQueue: true, bailoutOnError: true });
}
else
try
{
const selectedReferral =
this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer);
if (selectedReferral) {
await this.mainStore.loadSessionFromDuplicate(selectedReferral);
// If user clicked foward without selecting an option or user click on "start a new claim" button.
if (this.selectedAnswer == null || this.selectedAnswer === 'NewClaim') {
// Call SaveSession to create referral.
await saveSession({ shouldAwaitSaveSessionQueue: true, bailoutOnError: true });
}
else
{
const selectedReferral =
this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer);
if (selectedReferral) {
await this.mainStore.loadSessionFromDuplicate(selectedReferral);
}
}
// Call getCoveragePolicyInfo to get the policy info.
await this.mainStore.getCoveragePolicyInfo();
}
catch (error) {
// No error handling here needed.
// SaveSession will bailout.
// LoadSession will bailout.
// GetCoveragePolicyInfo handles exception / error internally.
}
// Call getCoveragePolicyInfo to get the policy info.
await this.mainStore.getCoveragePolicyInfo();
this.pushEventToGA("policy_search", "policy_found", this.mainStore.isPolicyLookupSuccessful ? "Yes" : "No", true);