Skip to content
Closed
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
13 changes: 12 additions & 1 deletion src/js/_enqueues/lib/auth-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,23 @@
setShowTimeout();
});
}).on( 'heartbeat-tick.wp-auth-check', function( e, data ) {
if ( 'wp-auth-check' in data ) {
if ( ! ( 'wp-auth-check' in data ) ) {
return;
}

var showOrHide = function () {
if ( ! data['wp-auth-check'] && wrap.hasClass( 'hidden' ) && ! tempHidden ) {
show();
} else if ( data['wp-auth-check'] && ! wrap.hasClass( 'hidden' ) ) {
hide();
}
};

// This is necessary due to a race condition where the heartbeat-tick event may fire before DOMContentLoaded.
if ( wrap ) {
showOrHide();
} else {
$( showOrHide );
}
});

Expand Down
Loading