diff --git a/projects/packages/jitm/changelog/hide-jitm-license-key-activation b/projects/packages/jitm/changelog/hide-jitm-license-key-activation new file mode 100644 index 000000000000..4bbfc4b0a936 --- /dev/null +++ b/projects/packages/jitm/changelog/hide-jitm-license-key-activation @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Prevent the activation page from displaying the JP License Activation JITM. diff --git a/projects/packages/jitm/src/class-jitm.php b/projects/packages/jitm/src/class-jitm.php index 8d68cb725619..9d51e0d3b19d 100644 --- a/projects/packages/jitm/src/class-jitm.php +++ b/projects/packages/jitm/src/class-jitm.php @@ -20,7 +20,7 @@ */ class JITM { - const PACKAGE_VERSION = '2.2.37'; + const PACKAGE_VERSION = '2.2.38-alpha'; /** * The configuration method that is called from the jetpack-config package. diff --git a/projects/packages/jitm/src/js/jetpack-jitm.js b/projects/packages/jitm/src/js/jetpack-jitm.js index 61c5837aea54..4d12182aa6f6 100644 --- a/projects/packages/jitm/src/js/jetpack-jitm.js +++ b/projects/packages/jitm/src/js/jetpack-jitm.js @@ -223,7 +223,14 @@ jQuery( document ).ready( function ( $ ) { var hash = location.hash; hash = hash.replace( /#\//, '_' ); - if ( '_dashboard' !== hash ) { + + // We always include the hash if this is My Jetpack page + if ( message_path.includes( 'jetpack_page_my-jetpack' )) { + message_path = message_path.replace( + 'jetpack_page_my-jetpack', + 'jetpack_page_my-jetpack' + hash + ); + } else if ( '_dashboard' !== hash ) { message_path = message_path.replace( 'toplevel_page_jetpack', 'toplevel_page_jetpack' + hash @@ -256,9 +263,10 @@ jQuery( document ).ready( function ( $ ) { reFetch(); $( window ).on( 'hashchange', function ( e ) { - var newURL = e.originalEvent.newURL; + const newURL = e.originalEvent.newURL; + const isJetpackPage = newURL.indexOf( 'jetpack#/' ) >= 0 || newURL.indexOf( 'my-jetpack' ) >= 0; - if ( newURL.indexOf( 'jetpack#/' ) >= 0 ) { + if ( isJetpackPage ) { var jitm_card = document.querySelector( '.jitm-card' ); if ( jitm_card ) { jitm_card.remove();