Skip to content

Commit

Permalink
fix: richTextHelper.js condition
Browse files Browse the repository at this point in the history
Co-authored-by: Piero Nicolli <[email protected]>
  • Loading branch information
giuliaghisini and pnicolli authored Oct 24, 2023
1 parent dc54b1c commit fc6e1ea
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/helpers/richTextHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { serializeNodesToText } from '@plone/volto-slate/editor/render';
*/
export const checkRichTextHasContent = (text) => {
if (text?.[0]?.children) {
return serializeNodesToText(text?.[0]?.children || [])?.length > 0
? true
: false;
return serializeNodesToText(text?.[0]?.children || [])?.length > 0;
}
return false;
};

0 comments on commit fc6e1ea

Please sign in to comment.