Skip to content

Commit

Permalink
Remove unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
miina authored and westonruter committed Nov 16, 2018
1 parent 22ff7aa commit 34301c1
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions assets/js/amp-block-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ var ampBlockValidation = ( function() { // eslint-disable-line no-unused-vars
* @return {void}
*/
handleValidationErrorsStateChange: function handleValidationErrorsStateChange() {
var currentPost, validationErrors, blockValidationErrors, noticeElement, noticeMessage, blockErrorCount, ampValidity;
var currentPost, validationErrors, blockValidationErrors, noticeOptions, noticeMessage, blockErrorCount, ampValidity;

if ( ! module.isAMPEnabled() ) {
if ( ! module.lastStates.noticesAreReset ) {
Expand Down Expand Up @@ -249,29 +249,20 @@ var ampBlockValidation = ( function() { // eslint-disable-line no-unused-vars
noticeMessage += wp.i18n.__( 'Non-accepted validation errors prevent AMP from being served, and the user will be redirected to the non-AMP version.', 'amp' );
}

noticeElement = wp.element.createElement( 'p', {}, [
noticeMessage + ' ',
ampValidity.review_link && wp.element.createElement(
'a',
{ key: 'review_link', href: ampValidity.review_link, target: '_blank' },
wp.i18n.__( 'Review issues', 'amp' )
)
] );

var options = {
noticeOptions = {
id: 'amp-errors-notice'
};
if ( ampValidity.review_link ) {
options.actions = [
noticeOptions.actions = [
{
label: wp.i18n.__( 'Review issues', 'amp' ),
url: ampValidity.review_link,
url: ampValidity.review_link
}
];
}

wp.data.dispatch( 'core/notices' ).createNotice( 'warning', noticeMessage, options );
module.validationWarningNoticeId = options.id;
wp.data.dispatch( 'core/notices' ).createNotice( 'warning', noticeMessage, noticeOptions );
module.validationWarningNoticeId = noticeOptions.id;
},

/**
Expand Down

0 comments on commit 34301c1

Please sign in to comment.