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() { async forwardButtonAction() {
showIssLoadingModal(true); showIssLoadingModal(true);
// If user clicked foward without selecting an option or user click on "start a new claim" button. try
if (this.selectedAnswer == null || this.selectedAnswer === 'NewClaim') {
// Call SaveSession to create referral.
await saveSession({ shouldAwaitSaveSessionQueue: true, bailoutOnError: true });
}
else
{ {
const selectedReferral = // If user clicked foward without selecting an option or user click on "start a new claim" button.
this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer); if (this.selectedAnswer == null || this.selectedAnswer === 'NewClaim') {
// Call SaveSession to create referral.
if (selectedReferral) { await saveSession({ shouldAwaitSaveSessionQueue: true, bailoutOnError: true });
await this.mainStore.loadSessionFromDuplicate(selectedReferral);
} }
} else
{
const selectedReferral =
this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer);
// Call getCoveragePolicyInfo to get the policy info. if (selectedReferral) {
await this.mainStore.getCoveragePolicyInfo(); 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.
}
this.pushEventToGA("policy_search", "policy_found", this.mainStore.isPolicyLookupSuccessful ? "Yes" : "No", true); this.pushEventToGA("policy_search", "policy_found", this.mainStore.isPolicyLookupSuccessful ? "Yes" : "No", true);