From 35aa650b8339de297ba59c3c5d82809ab0350d6e Mon Sep 17 00:00:00 2001 From: David Arenas Date: Tue, 12 Dec 2023 17:30:25 +0100 Subject: [PATCH] Update state definition --- packages/block-library/src/post-comments-form/index.php | 2 +- packages/block-library/src/post-comments-form/view.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/post-comments-form/index.php b/packages/block-library/src/post-comments-form/index.php index fa8c8c1f7d9151..dd19f952cae153 100644 --- a/packages/block-library/src/post-comments-form/index.php +++ b/packages/block-library/src/post-comments-form/index.php @@ -103,7 +103,7 @@ function render_block_core_post_comments_form( $attributes, $content, $block ) { // on submission. This is optional. if ( 'INPUT' === $tag && 'submit' === $type ) { // Add the necessary directives. - $p->set_attribute( 'data-wp-bind--value', 'state.submitText' ); + $p->set_attribute( 'data-wp-bind--value', 'state.submitButtonText' ); $p->set_attribute( 'data-wp-bind--disabled', 'context.isSubmitting' ); // Add translated strings to the state. diff --git a/packages/block-library/src/post-comments-form/view.js b/packages/block-library/src/post-comments-form/view.js index 500239fb396674..7c1084d8f66526 100644 --- a/packages/block-library/src/post-comments-form/view.js +++ b/packages/block-library/src/post-comments-form/view.js @@ -22,8 +22,9 @@ const { state } = store( 'core/comments', { get showError() { return state.error ? 'flex' : 'none'; }, - get submitText() { - const { isSubmitting, loadingText, submitText } = getContext(); + get submitButtonText() { + const { isSubmitting } = getContext(); + const { loadingText, submitText } = state; return isSubmitting ? loadingText : submitText; }, get displayCancelReply() {