Fix xhr callbacks
This commit is contained in:
parent
ea893b2322
commit
69ec37331a
@ -27,12 +27,12 @@ var Shynet = {
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
xhr.setRequestHeader("Content-Type", "application/json");
|
xhr.setRequestHeader("Content-Type", "application/json");
|
||||||
xhr.onload(function () {
|
xhr.onload = function () {
|
||||||
Shynet.skipHeartbeat = false;
|
Shynet.skipHeartbeat = false;
|
||||||
});
|
};
|
||||||
xhr.onerror(function () {
|
xhr.onerror = function () {
|
||||||
Shynet.skipHeartbeat = false;
|
Shynet.skipHeartbeat = false;
|
||||||
});
|
};
|
||||||
xhr.send(
|
xhr.send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
idempotency: Shynet.idempotency,
|
idempotency: Shynet.idempotency,
|
||||||
@ -43,7 +43,7 @@ var Shynet = {
|
|||||||
window.performance.timing.navigationStart,
|
window.performance.timing.navigationStart,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} catch (e) { }
|
} catch (e) {}
|
||||||
},
|
},
|
||||||
newPageLoad: function () {
|
newPageLoad: function () {
|
||||||
if (Shynet.heartbeatTaskId != null) {
|
if (Shynet.heartbeatTaskId != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user