SSR-1254. Fix existing claim still appear after WO is submitted. (#703)

This commit is contained in:
Johan Gunawan 2024-05-14 12:37:03 -04:00 committed by GitHub
parent eba95cc80b
commit bcd0076e44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -139,20 +139,23 @@ export default {
* @summary Steps to perform when forward button clicked. * @summary Steps to perform when forward button clicked.
*/ */
async forwardButtonAction() { async forwardButtonAction() {
if (this.selectedAnswer !== null) { if (this.selectedAnswer == null) {
const selectedReferral =
this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer);
if (selectedReferral) {
await this.mainStore
.loadSession(selectedReferral)
.catch(() => {})
.finally(() => {
this.navigateForward(); this.navigateForward();
});
return; return;
} }
try {
const selectedReferral =
this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer);
if (selectedReferral) {
await this.mainStore.loadSession(selectedReferral);
} }
} catch (err) {
console.error(`Error on loading session from duplicate check ${err}`);
} finally {
this.navigateForward(); this.navigateForward();
}
}, },
navigateForward() { navigateForward() {
if (!this.mainStore.order.policy.policyLookupSuccessful) { if (!this.mainStore.order.policy.policyLookupSuccessful) {
@ -164,6 +167,7 @@ export default {
} }
const policyVehicles = useMainStore().order.policy.vehicles ?? []; const policyVehicles = useMainStore().order.policy.vehicles ?? [];
if (!this.mainStore.order.loadedFromDupeCheck) { if (!this.mainStore.order.loadedFromDupeCheck) {
if (policyVehicles.length !== 0) { if (policyVehicles.length !== 0) {
this.$router.navigate( this.$router.navigate(