Client: Not yet loaded seats now show an hourglass loading spinner

This commit is contained in:
2022-03-05 14:40:09 +01:00
parent 06f9a49731
commit e78e7427ac
3 changed files with 12 additions and 7 deletions
-4
View File
@@ -2,7 +2,6 @@ package serverevents
import (
"fmt"
"log"
"net/http"
)
@@ -46,14 +45,11 @@ func (sse *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
client := make(chan string)
sse.clients[client] = true
log.Printf(`New connection`)
if sse.Connected != nil {
sse.Connected(client)
}
defer func() {
log.Printf(`Connection closed`)
close(client)
delete(sse.clients, client)
if sse.Disconnected != nil {