Fix acceptance test
MAILPOET-5949
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
36130c9809
commit
08ba9b1da9
@ -32,13 +32,15 @@ function SelectTemplateBody( {
|
||||
handleTemplateSelection,
|
||||
} ) {
|
||||
const [ selectedCategory, setSelectedCategory ] = useState(
|
||||
TemplateCategories[ 0 ].name // Show the “Recent” category by default
|
||||
TemplateCategories[ 1 ].name // Show the “Basic” category by default
|
||||
);
|
||||
|
||||
useEffect( () => {
|
||||
if ( ! hasEmailPosts ) {
|
||||
setSelectedCategory( TemplateCategories[ 1 ].name );
|
||||
}
|
||||
setTimeout( () => {
|
||||
if ( hasEmailPosts ) {
|
||||
setSelectedCategory( TemplateCategories[ 0 ].name );
|
||||
}
|
||||
}, 1000 ); // using setTimeout to ensure the template styles are available before block preview
|
||||
}, [ hasEmailPosts ] );
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user