Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

Commit

Permalink
Corrected number of copied blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdiyazdani committed Mar 3, 2020
1 parent 4c325c2 commit a6d62b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions assets/src/components/Copy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default compose(
getSelectedBlock
} = this.props,
getMultiSelectedBlocks = select( 'core/block-editor' ).getMultiSelectedBlocks(),
numBlocks = size( getMultiSelectedBlocks ) + 1;
numBlocks = size( getMultiSelectedBlocks );

if ( ! getSelectedBlock && size( getMultiSelectedBlocks ) < 1 ) return false;

Expand All @@ -64,7 +64,7 @@ export default compose(
>
{
/* translators: %s: number of blocks selected. */
sprintf( _n( 'Copy Block', 'Copy %s Blocks', numBlocks, 'block-copy' ), numBlocks )
sprintf( _n( 'Copy Block', 'Copy %s Blocks', numBlocks + 1, 'block-copy' ), numBlocks )
}
</ClipboardButton>
}
Expand Down
2 changes: 1 addition & 1 deletion assets/src/utils/withDispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const applyWithDispatch = withDispatch( dispatch => {
const selectedBlocks = select( 'core/block-editor' ).getMultiSelectedBlocks(),
numBlocks = size( selectedBlocks ),
/* translators: %s: number of blocks selected. */
notice = sprintf( _n( 'A single block copied.', '%s blocks copied.', numBlocks, 'block-copy' ), numBlocks );
notice = sprintf( _n( 'A single block copied.', '%s blocks copied.', numBlocks + 1, 'block-copy' ), numBlocks );

createNotice(
'info',
Expand Down

0 comments on commit a6d62b3

Please sign in to comment.