Skip to content

Commit

Permalink
Reformat with Prettier 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Dec 2, 2020
1 parent cb4ffad commit ab5e8c9
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 54 deletions.
35 changes: 17 additions & 18 deletions client/desktop/window-handlers/failed-to-load/index.js
Expand Up @@ -71,25 +71,24 @@ function failedToLoadError( mainWindow ) {
// @adlk: Keep in mind that every request, even the ones we do not control (e.g. atomic- or self hosted sites), might cause the app to "soft-crash" even though the user experience might not be affected directly by some requests that fail.
module.exports = function ( mainWindow ) {
// This attempts to catch some network errors and display an error screen in order to avoid a blank white page
mainWindow.webContents.on( 'did-fail-load', async function (
event,
errorCode,
errorDescription
) {
if ( ERRORS_TO_IGNORE.indexOf( errorCode ) === -1 ) {
if ( isErrorPage( event.sender ) ) {
failedToLoadError( mainWindow );
} else {
log.error(
'Failed to load from server, showing fallback page: code=' +
errorCode +
' ' +
errorDescription
);
mainWindow.webContents.on(
'did-fail-load',
async function ( event, errorCode, errorDescription ) {
if ( ERRORS_TO_IGNORE.indexOf( errorCode ) === -1 ) {
if ( isErrorPage( event.sender ) ) {
failedToLoadError( mainWindow );
} else {
log.error(
'Failed to load from server, showing fallback page: code=' +
errorCode +
' ' +
errorDescription
);

await mainWindow.webContents.session.setProxy( { proxyRules: 'direct://' } );
mainWindow.loadURL( FAILED_FILE + '#' + errorCode );
await mainWindow.webContents.session.setProxy( { proxyRules: 'direct://' } );
mainWindow.loadURL( FAILED_FILE + '#' + errorCode );
}
}
}
} );
);
};
21 changes: 11 additions & 10 deletions client/lib/cart/store/cart-synchronizer.js
Expand Up @@ -142,17 +142,18 @@ CartSynchronizer.prototype._processQueuedChanges = function () {
};

CartSynchronizer.prototype._postToServer = function ( callback ) {
this._wpcom.setCart( this._cartKey, preprocessCartForServer( this._latestValue ), function (
error,
newValue
) {
if ( error ) {
callback( error );
return;
}
this._wpcom.setCart(
this._cartKey,
preprocessCartForServer( this._latestValue ),
function ( error, newValue ) {
if ( error ) {
callback( error );
return;
}

callback( null, preprocessCartFromServer( newValue ) );
} );
callback( null, preprocessCartFromServer( newValue ) );
}
);
};

CartSynchronizer.prototype._poll = function () {
Expand Down
14 changes: 7 additions & 7 deletions client/lib/post-normalizer/rule-create-better-excerpt.js
Expand Up @@ -77,14 +77,14 @@ export function formatExcerpt( content ) {
stripLeadingBreaklines( dom );

// now limit it to the first three elements
forEach( dom.querySelectorAll( '#__better_excerpt__ > p, #__better_excerpt__ > br' ), function (
element,
index
) {
if ( index >= 3 ) {
element.parentNode && element.parentNode.removeChild( element );
forEach(
dom.querySelectorAll( '#__better_excerpt__ > p, #__better_excerpt__ > br' ),
function ( element, index ) {
if ( index >= 3 ) {
element.parentNode && element.parentNode.removeChild( element );
}
}
} );
);

// trim and replace   entities
const betterExcerpt = trim( dom.innerHTML.replace( / /g, ' ' ) );
Expand Down
20 changes: 10 additions & 10 deletions client/lib/wpcom-undocumented/lib/undocumented.js
Expand Up @@ -2410,17 +2410,17 @@ Undocumented.prototype.updateSiteAddress = function (
};

Undocumented.prototype.requestGdprConsentManagementLink = function ( domain, callback ) {
return this.wpcom.req.get( `/domains/${ domain }/request-gdpr-consent-management-link`, function (
error,
response
) {
if ( error ) {
callback( error );
return;
}
return this.wpcom.req.get(
`/domains/${ domain }/request-gdpr-consent-management-link`,
function ( error, response ) {
if ( error ) {
callback( error );
return;
}

callback( null, response );
} );
callback( null, response );
}
);
};

Undocumented.prototype.getDomainConnectSyncUxUrl = function (
Expand Down
Expand Up @@ -7,9 +7,7 @@ import styled from '@emotion/styled';

const debug = debugFactory( 'calypso:site-level-purchases-error-boundary' );

export default class SiteLevelPurchasesErrorBoundary extends React.Component<
SiteLevelPurchasesErrorBoundaryProps
> {
export default class SiteLevelPurchasesErrorBoundary extends React.Component< SiteLevelPurchasesErrorBoundaryProps > {
constructor( props: SiteLevelPurchasesErrorBoundaryProps ) {
super( props );
}
Expand Down
7 changes: 2 additions & 5 deletions packages/composite-checkout/src/components/checkout-steps.tsx
Expand Up @@ -863,8 +863,7 @@ const StepNumber = styled.div< StepNumberProps & React.HTMLAttributes< HTMLDivEl
// Reason: The IE media query needs to not have spaces within brackets otherwise ie11 doesn't read them
// prettier-ignore
@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {
z-index: ${ ( props ) =>
props.isComplete ? '0' : '1' };
z-index: ${ ( props ) => ( props.isComplete ? '0' : '1' ) };
}
`;

Expand All @@ -880,9 +879,7 @@ const StepNumberCompleted = styled( StepNumber )`
// prettier-ignore
@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {
backface-visibility: visible;
z-index: ${ (
props
) => ( props.isComplete ? '1' : '0' ) };
z-index: ${ ( props ) => ( props.isComplete ? '1' : '0' ) };
}
svg {
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/lib/pages/signup/pick-a-plan-page.js
Expand Up @@ -48,7 +48,9 @@ export default class PickAPlanPage extends AsyncBaseContainer {

if ( level === 'free' ) {
if ( ! ( await driverHelper.isElementPresent( this.driver, selector ) ) ) {
selector = By.css( '.plans-features-main__banner-content button, .formatted-header__subtitle button' );
selector = By.css(
'.plans-features-main__banner-content button, .formatted-header__subtitle button'
);
}
}
await driverHelper.waitTillPresentAndDisplayed(
Expand Down

0 comments on commit ab5e8c9

Please sign in to comment.