diff --git a/src/client/Elements/Input.jsx b/src/client/Elements/Input.jsx index d0a3a8b..022d60b 100644 --- a/src/client/Elements/Input.jsx +++ b/src/client/Elements/Input.jsx @@ -29,11 +29,11 @@ const Input = ({ // set Value to global store and run Effects useEffect(() => { if (sourceValueName && debouncedValue) { - calculationStore.setValue(sourceValueName, debouncedValue).then(() => { - if (Effects && Effects.length > 0) { - runEffects(Effects, calculationStore); - } - }); + calculationStore.setValue(sourceValueName, debouncedValue); + } + + if (Effects && Effects.length > 0) { + runEffects(Effects, calculationStore); } }, [debouncedValue]); diff --git a/src/client/hocs/withTitle.jsx b/src/client/hocs/withTitle.jsx index 75f0722..0e5ee33 100644 --- a/src/client/hocs/withTitle.jsx +++ b/src/client/hocs/withTitle.jsx @@ -2,7 +2,7 @@ import React from "react"; import { Flex } from "client/UIKit/grid"; const withTitle = (title) => (Component) => (props) => ( - +
{title}
diff --git a/src/client/stores/CalculationStore/CalculationStore.ts b/src/client/stores/CalculationStore/CalculationStore.ts index a073550..6304330 100644 --- a/src/client/stores/CalculationStore/CalculationStore.ts +++ b/src/client/stores/CalculationStore/CalculationStore.ts @@ -10,12 +10,10 @@ class CalculationStore { getValue = (sourceValueName: SourceValueNames) => this.values[sourceValueName]; - setValue = action( - async (sourceValueName: SourceValueNames, newValue: any) => { - this.values[sourceValueName] = newValue; - // TODO: Run effect here - } - ); + setValue = action((sourceValueName: SourceValueNames, newValue: any) => { + this.values[sourceValueName] = newValue; + // TODO: Run effect here + }); getStatus = (elementName: string) => this.statuses[elementName]; setStatus = action((elementName: string, status: Status) => {