diff --git a/process/lead-opportunity/reactions/common.ts b/process/lead-opportunity/reactions/common.ts index e9054d7..9d6e485 100644 --- a/process/lead-opportunity/reactions/common.ts +++ b/process/lead-opportunity/reactions/common.ts @@ -65,6 +65,9 @@ export default function commonReactions(store: RootStore, apolloClient: ApolloCl reaction( () => $calculation.getElementValue('selectOpportunity'), async (opportunityid) => { + if (!opportunityid) { + return; + } const { data } = await apolloClient.query({ query: QUERY_GET_LEADID_BY_OPPORTUNITY, variables: { diff --git a/process/lead-opportunity/reactions/urls.ts b/process/lead-opportunity/reactions/urls.ts index 790b8e9..cb98b45 100644 --- a/process/lead-opportunity/reactions/urls.ts +++ b/process/lead-opportunity/reactions/urls.ts @@ -14,6 +14,10 @@ export default function urlsReactions(store: RootStore, apolloClient: ApolloClie reaction( () => $calculation.getElementValue(elementName), (id) => { + if (!id) { + $calculation.resetElementValue(linkElementName); + } + const timeoutId = setTimeout(() => { $calculation.$status.setStatus(linkElementName, 'Loading'); }, 1200); @@ -33,7 +37,7 @@ export default function urlsReactions(store: RootStore, apolloClient: ApolloClie }) .catch(() => { clearTimeout(timeoutId); - $calculation.setElementValue(linkElementName, null); + $calculation.resetElementValue(linkElementName); }); } );