Fix connection indicator script duplication on SSE patches #12

Merged
ryan merged 1 commits from fix/connection-indicator-script into main 2026-03-03 20:44:57 +00:00

View File

@@ -52,6 +52,8 @@ func isStale(lastPing int64) bool {
return lastPing == 0
}
var connectionWatcherHandle = templ.NewOnceHandle()
// ConnectionIndicator shows a small dot indicating SSE connection status.
// Server patches this with a timestamp; client JS detects staleness.
templ ConnectionIndicator(lastPing int64) {
@@ -79,8 +81,10 @@ templ ConnectionIndicator(lastPing int64) {
></div>
</div>
</div>
@connectionWatcherHandle.Once() {
@connectionWatcher()
}
}
script connectionWatcher() {
setInterval(function() {