This commit is contained in:
Chris McCord 2022-01-31 15:42:41 -05:00
parent 8cd6048d4b
commit 1975f85cfe
2 changed files with 1 additions and 2 deletions

View file

@ -183,7 +183,7 @@ Hooks.Ping = {
this.handleEvent("pong", () => { this.handleEvent("pong", () => {
let rtt = Date.now() - this.nowMs let rtt = Date.now() - this.nowMs
this.el.innerText = `ping: ${rtt}ms` this.el.innerText = `ping: ${rtt}ms`
this.timer = setTimeout(() => this.ping(rtt), 100) this.timer = setTimeout(() => this.ping(rtt), 1000)
}) })
this.ping(null) this.ping(null)
}, },

View file

@ -93,7 +93,6 @@ defmodule LiveBeatsWeb.Presence.BadgeComponent do
def update(%{action: {:ping, action}}, socket) do def update(%{action: {:ping, action}}, socket) do
%{user: user, ping: ping, region: region} = action %{user: user, ping: ping, region: region} = action
{:ok, assign(socket, presence: user, ping: ping, region: region)} {:ok, assign(socket, presence: user, ping: ping, region: region)}
end end