Skip to content

Commit

Permalink
Remove redundant code.
Browse files Browse the repository at this point in the history
  • Loading branch information
miina committed Oct 22, 2019
1 parent 005d62e commit 63850c9
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions assets/src/stories-editor/blocks/amp-story-page/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,10 @@ const PageEdit = ( {
return;
}
// If there is an illegal number of immovable blocks (more than 1).
if ( immovableBlocks.length > 1 ) {
if ( 1 !== immovableBlocks.length ) {
return;
}
const ctaBlock = getCallToActionBlock( clientId );
const attachmentBlock = getPageAttachmentBlock( clientId );

let blockToMove = null;

if ( ctaBlock ) {
blockToMove = ctaBlock;
} else if ( attachmentBlock ) {
blockToMove = attachmentBlock;
}
const blockToMove = immovableBlocks[ 0 ];

if ( blockToMove ) {

This comment has been minimized.

Copy link
@barklund

barklund Oct 22, 2019

Contributor

This if is also redundant now, as there will always be a block at this point.

This comment has been minimized.

Copy link
@miina

miina Oct 22, 2019

Author Contributor

Changed within 2eccdec

// If the either CTA or Attachment is not the last block, move it there.
Expand Down

0 comments on commit 63850c9

Please sign in to comment.