WordPress.org

Make WordPress Core

Changeset 24577


Ignore:
Timestamp:
07/05/2013 11:33:47 PM (5 years ago)
Author:
azaozz
Message:

Heartbeat:

  • Pass the actual error to the jQuery event 'heartbeat-connection-lost'.
  • When in error state, keep trying to connect even when no response is expected until the error is cleared.

See #23216.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/heartbeat.js

    r24528 r24577  
    108108                if ( trigger && ! self.connectionLost ) {
    109109                    self.connectionLost = true;
    110                     $(document).trigger( 'heartbeat-connection-lost' );
     110                    $(document).trigger( 'heartbeat-connection-lost', [error] );
    111111                }
    112112            } else if ( self.connectionLost ) {
     
    137137            // If nothing to send (nothing is expecting a response),
    138138            // schedule the next tick and bail
    139             if ( empty ) {
     139            if ( empty && ! self.connectionLost ) {
    140140                connecting = false;
    141141                next();
Note: See TracChangeset for help on using the changeset viewer.