From 744719464442a84fdab8e5c1e6246c801cd6c99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20Van=C2=A0Dorpe?= Date: Thu, 30 Aug 2018 11:44:39 +0200 Subject: [PATCH] Add RichText.isEmpty (#9249) * Add RichText.isEmpty * Consolidate isEmpty checks * chore: Use isRichTextValueEmpty directly over passing through class method * Use this.isEmpty --- packages/block-library/src/audio/edit.js | 2 +- packages/block-library/src/audio/index.js | 2 +- .../block-library/src/cover-image/index.js | 6 ++-- packages/block-library/src/embed/index.js | 6 ++-- packages/block-library/src/image/edit.js | 4 +-- packages/block-library/src/image/index.js | 6 ++-- packages/block-library/src/list/index.js | 8 ++--- packages/block-library/src/pullquote/index.js | 6 ++-- packages/block-library/src/quote/index.js | 8 ++--- packages/block-library/src/video/edit.js | 2 +- packages/block-library/src/video/index.js | 2 +- .../editor/src/components/rich-text/index.js | 31 +++++++++++++------ 12 files changed, 47 insertions(+), 36 deletions(-) diff --git a/packages/block-library/src/audio/edit.js b/packages/block-library/src/audio/edit.js index 4faa7be955f6a5..df34522d7d3cb2 100644 --- a/packages/block-library/src/audio/edit.js +++ b/packages/block-library/src/audio/edit.js @@ -163,7 +163,7 @@ class AudioEdit extends Component { - { ( ( caption && caption.length ) || !! isSelected ) && ( + { ( ! RichText.isEmpty( caption ) || isSelected ) && (