From 0a31e5471241de55be7c9e9bbea3ed5925a88c06 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 fa8c8c1f7d915..dd19f952cae15 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 500239fb39667..7c1084d8f6652 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() {