diff --git a/src/js/vapi-client.js b/src/js/vapi-client.js index 26bc6d8f0..4460bba35 100644 --- a/src/js/vapi-client.js +++ b/src/js/vapi-client.js @@ -29,6 +29,8 @@ var messagingConnector = function(response) { if (response.requestId) { listener = vAPI.messaging.listeners[response.requestId]; + delete vAPI.messaging.listeners[response.requestId]; + delete response.requestId; } if (!listener) { @@ -37,14 +39,6 @@ var messagingConnector = function(response) { } if (typeof listener === 'function') { - // Safari bug - // Deleting the response.requestId below (only in some cases, probably - // when frames are present on the page) will remove it from all the - // future messages too, however with the following line it won't. - vAPI.safari && console.log; - - delete vAPI.messaging.listeners[response.requestId]; - delete response.requestId; listener(response.msg); } };