🎨 Improve UI response after background wakeup on the Android https://github.com/siyuan-note/siyuan/issues/8441

This commit is contained in:
Daniel 2023-06-03 12:21:59 +08:00
parent ce836a2457
commit b4800653fa
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 44 additions and 10 deletions

View file

@ -373,11 +373,11 @@ func serveWebSocket(ginServer *gin.Engine) {
})
util.WebSocketServer.HandlePong(func(session *melody.Session) {
logging.LogInfof("pong")
//logging.LogInfof("pong")
})
util.WebSocketServer.HandleConnect(func(s *melody.Session) {
logging.LogInfof("ws check auth for [%s]", s.Request.RequestURI)
//logging.LogInfof("ws check auth for [%s]", s.Request.RequestURI)
authOk := true
if "" != model.Conf.AccessAuthCode {
@ -415,24 +415,24 @@ func serveWebSocket(ginServer *gin.Engine) {
}
util.AddPushChan(s)
sessionId, _ := s.Get("id")
logging.LogInfof("ws [%s] connected", sessionId)
//sessionId, _ := s.Get("id")
//logging.LogInfof("ws [%s] connected", sessionId)
})
util.WebSocketServer.HandleDisconnect(func(s *melody.Session) {
util.RemovePushChan(s)
sessionId, _ := s.Get("id")
logging.LogInfof("ws [%s] disconnected", sessionId)
//sessionId, _ := s.Get("id")
//logging.LogInfof("ws [%s] disconnected", sessionId)
})
util.WebSocketServer.HandleError(func(s *melody.Session, err error) {
sessionId, _ := s.Get("id")
logging.LogDebugf("ws [%s] failed: %s", sessionId, err)
//sessionId, _ := s.Get("id")
//logging.LogWarnf("ws [%s] failed: %s", sessionId, err)
})
util.WebSocketServer.HandleClose(func(s *melody.Session, i int, str string) error {
sessionId, _ := s.Get("id")
logging.LogDebugf("ws [%s] closed: %v, %v", sessionId, i, str)
//sessionId, _ := s.Get("id")
//logging.LogDebugf("ws [%s] closed: %v, %v", sessionId, i, str)
return nil
})