From fa2a6b856ef264fdbd6589685c51ab67494f0867 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: http://core.svn.wordpress.org/trunk@24577 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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;