diff --git a/features/common/components/shared.templ b/features/common/components/shared.templ index a9b783b..d5f68c0 100644 --- a/features/common/components/shared.templ +++ b/features/common/components/shared.templ @@ -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,7 +81,9 @@ templ ConnectionIndicator(lastPing int64) { > - @connectionWatcher() + @connectionWatcherHandle.Once() { + @connectionWatcher() + } } script connectionWatcher() {