feat: added disabling of runProgram button if program is not valid
ref: N25B-450
This commit is contained in:
@@ -186,10 +186,17 @@ function graphReducer() {
|
||||
* @constructor
|
||||
*/
|
||||
function VisProgPage() {
|
||||
const [programValidity, setProgramValidity] = useState<boolean>(true);
|
||||
const sIndex = useFlowStore.getState().severityIndex;
|
||||
|
||||
useEffect(() => {
|
||||
setProgramValidity(useFlowStore.getState().isProgramValid)
|
||||
}, [sIndex]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<VisualProgrammingUI/>
|
||||
<button onClick={runProgram}>run program</button>
|
||||
<button onClick={runProgram} disabled={programValidity}>run program</button>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user