Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Prevent the activation page from displaying the JP License Activation JITM.
2 changes: 1 addition & 1 deletion projects/packages/jitm/src/class-jitm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 11 additions & 3 deletions projects/packages/jitm/src/js/jetpack-jitm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down