Skip to content

Commit

Permalink
Improve keepalive logic
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Oct 23, 2024
1 parent 4d32e53 commit 61d83bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Stipple"
uuid = "4acbeb90-81a0-11ea-1966-bdaff8155998"
authors = ["Adrian <[email protected]> and the Stipple contributors"]
version = "0.28.14"
version = "0.28.15"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
6 changes: 4 additions & 2 deletions assets/js/keepalive.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
*/

function keepalive() {
if (Date.now() - _lastMessageAt < Genie.Settings.webchannels_keepalive_frequency) {
return
if (window._lastMessageAt !== undefined) {
if (Date.now() - window._lastMessageAt < Genie.Settings.webchannels_keepalive_frequency) {
return
}
}

if (Genie.Settings.env == 'dev') {
Expand Down

0 comments on commit 61d83bc

Please sign in to comment.