Skip to content

Commit 1ac14bd

Browse files
committed
@hotwired/turbo-rails v8.0.14
1 parent cb47713 commit 1ac14bd

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

app/assets/javascripts/turbo.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5490,8 +5490,8 @@ window.Turbo = Turbo$1;
54905490
addEventListener("turbo:before-fetch-request", encodeMethodIntoRequestBody);
54915491

54925492
var adapters = {
5493-
logger: typeof console !== "undefined" ? console : undefined,
5494-
WebSocket: typeof WebSocket !== "undefined" ? WebSocket : undefined
5493+
logger: self.console,
5494+
WebSocket: self.WebSocket
54955495
};
54965496

54975497
var logger = {
@@ -5533,11 +5533,12 @@ class ConnectionMonitor {
55335533
isRunning() {
55345534
return this.startedAt && !this.stoppedAt;
55355535
}
5536-
recordMessage() {
5536+
recordPing() {
55375537
this.pingedAt = now();
55385538
}
55395539
recordConnect() {
55405540
this.reconnectAttempts = 0;
5541+
this.recordPing();
55415542
delete this.disconnectedAt;
55425543
logger.log("ConnectionMonitor recorded connect");
55435544
}
@@ -5736,7 +5737,6 @@ Connection.prototype.events = {
57365737
return;
57375738
}
57385739
const {identifier: identifier, message: message, reason: reason, reconnect: reconnect, type: type} = JSON.parse(event.data);
5739-
this.monitor.recordMessage();
57405740
switch (type) {
57415741
case message_types.welcome:
57425742
if (this.triedToReconnect()) {
@@ -5752,7 +5752,7 @@ Connection.prototype.events = {
57525752
});
57535753

57545754
case message_types.ping:
5755-
return null;
5755+
return this.monitor.recordPing();
57565756

57575757
case message_types.confirmation:
57585758
this.subscriptions.confirmSubscription(identifier);

0 commit comments

Comments
 (0)