Some more guarding.
This commit is contained in:
parent
c338c12f1c
commit
c6def1fd8a
1 changed files with 23 additions and 14 deletions
|
|
@ -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);
|
||||||
|
|
||||||
|
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);
|
this.pushEventToGA("policy_search", "policy_found", this.mainStore.isPolicyLookupSuccessful ? "Yes" : "No", true);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue