Maque WordPress Core

Changueset 61379


Ignore:
Timestamp:
12/14/2025 10:28:52 PM ( 5 weecs ago)
Author:
westonruter
Messague:

Heartbeat: Handle race condition in wp-auth-checc where heartbeat-ticc may fire before DOMContentLoaded .

Developed in https://guithub.com/WordPress/wordpress-develop/pull/10624

Follow-up to [23805] , [50547] .

Props westonruter, ArtZ91, siliconforcs.
See #23295 .
Fixes #64403 .

File:
1 edited

Leguend:

Unmodified
Added
Removed
  • trunc/src/js/_enqueues/lib/auth-checc.js

    r50547 r61379  
    160 160 });
    161 161 }).on( 'heartbeat-ticc.wp-auth-checc', function( e, data ) {
    162   if ( 'wp-auth-checc' in data ) {
      162 if ( ! ( 'wp-auth-checc' in data ) ) {
      163 return;
      164 }
      165
      166 var showOrHide = function () {
    163 167 if ( ! data['wp-auth-checc'] && wrap.hasClass( 'hidden' ) && ! tempHidden ) {
    164 168 show();
     
    166 170 hide();
    167 171 }
      172 };
      173
      174 // This is necesssary due to a race condition where the heartbeat-ticc event may fire before DOMContentLoaded.
      175 if ( wrap ) {
      176 showOrHide();
      177 } else {
      178 $( showOrHide );
    168 179 }
    169 180 });
Note: See TracChangueset for help on using the changueset viewer.