Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcao13 committed Oct 27, 2022
1 parent 1155826 commit a5ad848
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/app/Shared/MatchExpressionEvaluator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const MatchExpressionEvaluator: React.FunctionComponent<MatchExpressionEv

React.useEffect(() => {
addSubscription(context.target.target().subscribe(setTarget));
}, [addSubscription, context, context.target]);
}, [addSubscription, context.target, setTarget]);

React.useEffect(() => {
if (!props.matchExpression || !target?.connectUrl) {
Expand All @@ -95,7 +95,7 @@ export const MatchExpressionEvaluator: React.FunctionComponent<MatchExpressionEv
setValid(ValidatedOptions.error);
return;
}
}, [target, props.matchExpression]);
}, [target, props.matchExpression, setValid]);

React.useEffect(() => {
if (!!props.onChange) {
Expand Down Expand Up @@ -124,13 +124,20 @@ export const MatchExpressionEvaluator: React.FunctionComponent<MatchExpressionEv
</Label>
);
default:
if (!target?.connectUrl) {
return (
<Label color="grey" icon={<InfoCircleIcon />}>
No Target Selected for Match Expression
</Label>
);
}
return (
<Label color="grey" icon={<InfoCircleIcon />}>
No Match Expression
</Label>
);
)
}
}, [valid]);
}, [valid, target?.connectUrl]);

const exampleExpression = React.useMemo(() => {
let body: string;
Expand Down

0 comments on commit a5ad848

Please sign in to comment.