Skip to content

Commit

Permalink
Update state definition
Browse files Browse the repository at this point in the history
  • Loading branch information
DAreRodz authored and ockham committed Dec 16, 2023
1 parent 5cb426e commit 0a31e54
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 0a31e54

Please sign in to comment.