Skip to content

Commit

Permalink
Calypso editor: set Calypsoify for sites running Jetpack 9.2.1+
Browse files Browse the repository at this point in the history
Follow-up from #47925

Jetpack's Calypsoify broke in version 9.2, and was then fixed in 9.2.1.
We consequently only need to exclude sites that run 9.2 (alpha, betas, and stable).
  • Loading branch information
jeherve committed Dec 16, 2020
1 parent 5ae28aa commit 704eaa3
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import { getSiteOption } from 'calypso/state/sites/selectors';
import versionCompare from 'calypso/lib/version-compare';

export const isEligibleForGutenframe = ( state, siteId ) => {
// On some Jetpack sites (9.2+, not Atomic),
// Calypsoify is currently broken.
// On some Jetpack sites (9.2, not Atomic),
// Calypsoify is broken.
// Let's not enable it for them.
// Reference: https://github.com/Automattic/jetpack/pull/17939
// This problem was then fixed in Jetpack 9.2.1.
const jetpackVersion = getSiteOption( state, siteId, 'jetpack_version' );
const isBrokenJetpack =
jetpackVersion &&
versionCompare( jetpackVersion, '9.2-alpha', '>=' ) &&
versionCompare( jetpackVersion, '9.2.1', '<=' ) &&
! isAtomicSite( state, siteId );

return ! isBrokenJetpack && get( state, [ 'gutenbergIframeEligible', siteId ], true );
Expand Down

0 comments on commit 704eaa3

Please sign in to comment.