Enha: sse update on actions
This commit is contained in:
@ -149,6 +149,7 @@ func HandleJoinTeam(w http.ResponseWriter, r *http.Request) {
|
||||
abortWithError(w, err.Error())
|
||||
return
|
||||
}
|
||||
notify(models.NotifyRoomUpdatePrefix+fi.Room.ID, "")
|
||||
tmpl.ExecuteTemplate(w, "base", fi)
|
||||
}
|
||||
|
||||
@ -176,6 +177,7 @@ func HandleEndTurn(w http.ResponseWriter, r *http.Request) {
|
||||
abortWithError(w, err.Error())
|
||||
return
|
||||
}
|
||||
notify(models.NotifyRoomUpdatePrefix+fi.Room.ID, "")
|
||||
tmpl.ExecuteTemplate(w, "base", fi)
|
||||
}
|
||||
|
||||
@ -204,6 +206,8 @@ func HandleStartGame(w http.ResponseWriter, r *http.Request) {
|
||||
abortWithError(w, err.Error())
|
||||
return
|
||||
}
|
||||
// to update only the room that should be updated
|
||||
notify(models.NotifyRoomUpdatePrefix+fi.Room.ID, "")
|
||||
tmpl.ExecuteTemplate(w, "room", fi)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user