add 'onAbort' hook to realtime-input.js
This commit is contained in:
@@ -105,6 +105,7 @@ define([
|
||||
// bind abort to onLeaving
|
||||
var abort = function (socket, realtime) {
|
||||
realtime.abort();
|
||||
realtime.toolbar.failed();
|
||||
try { socket._socket.close(); } catch (e) { warn(e); }
|
||||
};
|
||||
|
||||
@@ -293,6 +294,11 @@ define([
|
||||
if (recoverableErrorCount >= MAX_RECOVERABLE_ERRORS) {
|
||||
warn("Giving up!");
|
||||
abort(socket, realtime);
|
||||
if (config.onAbort) {
|
||||
config.onAbort({
|
||||
socket
|
||||
});
|
||||
}
|
||||
if (socketChecker) { clearInterval(socketChecker); }
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user