From 0d71651c9ffd5acc381deecc56cace7ce8d89ec5 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 5 Jul 2013 23:33:47 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@24577 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/heartbeat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/js/heartbeat.js b/wp-includes/js/heartbeat.js index 09b38c77f0..200cff0d21 100644 --- a/wp-includes/js/heartbeat.js +++ b/wp-includes/js/heartbeat.js @@ -107,7 +107,7 @@ window.wp = window.wp || {}; if ( trigger && ! self.connectionLost ) { self.connectionLost = true; - $(document).trigger( 'heartbeat-connection-lost' ); + $(document).trigger( 'heartbeat-connection-lost', [error] ); } } else if ( self.connectionLost ) { errorcount = 0; @@ -136,7 +136,7 @@ window.wp = window.wp || {}; // If nothing to send (nothing is expecting a response), // schedule the next tick and bail - if ( empty ) { + if ( empty && ! self.connectionLost ) { connecting = false; next(); return;