Skip to content

Commit cf4df1e

Browse files
committed
yarn build
1 parent f755b1b commit cf4df1e

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
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: self.console,
5494-
WebSocket: self.WebSocket
5493+
logger: typeof console !== "undefined" ? console : undefined,
5494+
WebSocket: typeof WebSocket !== "undefined" ? WebSocket : undefined
54955495
};
54965496

54975497
var logger = {
@@ -5533,12 +5533,11 @@ class ConnectionMonitor {
55335533
isRunning() {
55345534
return this.startedAt && !this.stoppedAt;
55355535
}
5536-
recordPing() {
5536+
recordMessage() {
55375537
this.pingedAt = now();
55385538
}
55395539
recordConnect() {
55405540
this.reconnectAttempts = 0;
5541-
this.recordPing();
55425541
delete this.disconnectedAt;
55435542
logger.log("ConnectionMonitor recorded connect");
55445543
}
@@ -5737,6 +5736,7 @@ Connection.prototype.events = {
57375736
return;
57385737
}
57395738
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 this.monitor.recordPing();
5755+
return null;
57565756

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

0 commit comments

Comments
 (0)