fix prev commit

This commit is contained in:
Chika 2022-07-13 13:04:08 +03:00
parent 412a34158e
commit 71650fd31d
2 changed files with 8 additions and 1 deletions

View File

@ -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<GetLeadidByOpportunity>({
query: QUERY_GET_LEADID_BY_OPPORTUNITY,
variables: {

View File

@ -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);
});
}
);