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

main
Antonio De Lucreziis 3 years ago
parent 06f9a49731
commit e78e7427ac

@ -77,11 +77,13 @@ export async function createSeatWidget($roomGrid, roomId) {
if (occupiedBy.length === 0) {
const confirmResponse = confirm('Occupare il posto?')
if (confirmResponse) {
$seat.classList.remove('libero')
Database.occupySeat(seatId)
}
} else if (occupiedBy.length === 1 && occupiedBy[0] === user.id) {
const answer = confirm('Lasciare veramente il posto?')
if (answer) {
$seat.classList.remove('mio')
Database.leaveSeat(seatId)
}
} else {

@ -311,9 +311,16 @@ main {
line-height: 1;
&:not(.mio, .libero, .occupato)::before {
font-size: 12px;
content: '';
&:not(.mio, .libero, .occupato) {
&::before {
font-size: 12px;
content: '';
animation: rotating 1s linear infinite;
}
&::after {
content: none;
}
}
&::before {

@ -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 {

Loading…
Cancel
Save