Skip to content

Commit

Permalink
Update state definition
Browse files Browse the repository at this point in the history
  • Loading branch information
DAreRodz committed Dec 12, 2023
1 parent da4d6dd commit 35aa650
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-comments-form/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions packages/block-library/src/post-comments-form/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 35aa650

Please sign in to comment.