Skip to content

Commit ad167d8

Browse files
committed
chore: allow editing of conditions without saving in free
1 parent 7963184 commit ad167d8

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

css/settings.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,10 +2365,6 @@ li.draggable-item .components-panel__body-toggle.components-button{
23652365
padding: 24px 0;
23662366
}
23672367

2368-
.fz-conditions .components-disabled {
2369-
opacity: 0.5;
2370-
}
2371-
23722368
.fz-condition-control .components-button {
23732369
width: 100%;
23742370
margin: 0;

js/Conditions/conditions.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* WordPress dependencies.
33
*/
4-
import { Disabled } from '@wordpress/components';
5-
64
import domReady from '@wordpress/dom-ready';
75

86
import {
@@ -34,29 +32,26 @@ const App = () => {
3432
} );
3533

3634
useEffect( () => {
35+
if ( ! feedzyData.isPro ) {
36+
setConditions( dummyConditions );
37+
return
38+
}
39+
3740
const field = document.getElementById( 'feed-post-filters-conditions' );
3841
if ( field && field.value ) {
3942
const parsedConditions = JSON.parse( field.value );
40-
console.log( parsedConditions && parsedConditions.conditions ? parsedConditions : { conditions: [], match: 'all' } )
4143
setConditions( parsedConditions && parsedConditions.conditions ? parsedConditions : { conditions: [], match: 'all' } );
4244
}
4345
}, [] );
4446

4547
useEffect( () => {
48+
if ( ! feedzyData.isPro ) {
49+
return
50+
}
51+
4652
document.getElementById( 'feed-post-filters-conditions' ).value = JSON.stringify( conditions );
4753
}, [ conditions ] );
4854

49-
if ( ! feedzyData.isPro ) {
50-
return (
51-
<Disabled>
52-
<ConditionsControl
53-
conditions={ dummyConditions }
54-
setConditions={ setConditions }
55-
/>
56-
</Disabled>
57-
);
58-
}
59-
6055
return (
6156
<ConditionsControl
6257
conditions={ conditions }

0 commit comments

Comments
 (0)