| @@ -69,9 +69,9 @@ | ||
| 69 | 69 | } catch(e) { |
| 70 | 70 | response = data.callbacks[uid]; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if ('undefined' != typeof(response.result) && false === response.result) { | |
| 73 | + if ('undefined' != typeof(response.result) && false === response.result && ('undefined' == typeof(response.skip_notice) || false === response.skip_notice)) { | |
| 74 | 74 | wp_optimize.notices.show_notice(response.error_code, response.error_message); |
| 75 | 75 | } else { |
| 76 | 76 | if ('undefined' !== typeof(WP_Optimize_Heartbeat_Agents[uid]) && WP_Optimize_Heartbeat_Agents[uid].callback instanceof Function) { |
| 77 | 77 | WP_Optimize_Heartbeat_Agents[uid].callback(response); |
| @@ -133,11 +133,14 @@ | ||
| 133 | 133 | * @returns {boolean} |
| 134 | 134 | */ |
| 135 | 135 | function do_agents_match(agent1, agent2) { |
| 136 | 136 | var command_matches = agent1.command === agent2.command; |
| 137 | + var subaction1 = agent1.command_data && agent1.command_data.subaction ? agent1.command_data.subaction : undefined; | |
| 138 | + var subaction2 = agent2.command_data && agent2.command_data.subaction ? agent2.command_data.subaction : undefined; | |
| 139 | + var subaction_matches = subaction1 === subaction2; | |
| 137 | 140 | var command_not_sent_yet = false === agent1.sent; |
| 138 | 141 | |
| 139 | - return command_matches && command_not_sent_yet; | |
| 142 | + return command_matches && subaction_matches && command_not_sent_yet; | |
| 140 | 143 | } |
| 141 | 144 | |
| 142 | 145 | /** |
| 143 | 146 | * Add a heartbeat agent that will be sent to backend and has a callback to receive the response |