From 63850c9694c20625eeabcca7a6462941157cf5e1 Mon Sep 17 00:00:00 2001 From: Miina Sikk Date: Tue, 22 Oct 2019 20:07:28 +0200 Subject: [PATCH] Remove redundant code. --- .../stories-editor/blocks/amp-story-page/edit.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/assets/src/stories-editor/blocks/amp-story-page/edit.js b/assets/src/stories-editor/blocks/amp-story-page/edit.js index 55e28dcd512..dc110d10271 100644 --- a/assets/src/stories-editor/blocks/amp-story-page/edit.js +++ b/assets/src/stories-editor/blocks/amp-story-page/edit.js @@ -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 ) { // If the either CTA or Attachment is not the last block, move it there.