Skip to content

Commit d7533d2

Browse files
fix: user interaction with pro features
1 parent 5bde3d5 commit d7533d2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

js/Conditions/ConditionsControl.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const SUPPORTED_FIELDS = [
5656
];
5757

5858
const ConditionsControl = ({ conditions, setConditions }) => {
59+
const isPro = window.feedzyData.isPro;
5960
const onChangeMatch = (value) => {
6061
setConditions({
6162
...conditions,
@@ -88,6 +89,10 @@ const ConditionsControl = ({ conditions, setConditions }) => {
8889
};
8990

9091
const onChangeCondtion = (index, value, key) => {
92+
if (!isPro) {
93+
return;
94+
}
95+
9196
const conditionsCopy = [...conditions.conditions];
9297

9398
conditionsCopy[index][key] = value;
@@ -117,7 +122,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
117122
return (
118123
<div
119124
className={classNames('fz-condition-control', {
120-
'is-upsell': !window.feedzyData.isPro,
125+
'is-upsell': !isPro,
121126
})}
122127
>
123128
<SelectControl
@@ -137,6 +142,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
137142
},
138143
]}
139144
onChange={onChangeMatch}
145+
disabled={!isPro}
140146
/>
141147

142148
{conditions.conditions.map((condition, index) => {
@@ -161,6 +167,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
161167
onChange={(value) =>
162168
onChangeCondtion(index, value, 'field')
163169
}
170+
disabled={!isPro}
164171
/>
165172

166173
<SelectControl
@@ -185,6 +192,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
185192
onChange={(value) =>
186193
onChangeCondtion(index, value, 'operator')
187194
}
195+
disabled={!isPro}
188196
/>
189197

190198
{!['has_value', 'empty'].includes(
@@ -203,6 +211,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
203211
'value'
204212
)
205213
}
214+
disabled={!isPro}
206215
/>
207216
) : (
208217
<TextControl
@@ -215,6 +224,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
215224
'value'
216225
)
217226
}
227+
disabled={!isPro}
218228
/>
219229
)}
220230
</>

0 commit comments

Comments
 (0)