0

Fix incorrect handling of messages array. Closes #1287

This commit is contained in:
Gabe Kangas 2021-07-31 12:48:42 -07:00
parent cb7a9b89ea
commit 12cbe529de
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ func (s *ChatServer) Addclient(conn *websocket.Conn, user *user.User, accessToke
User: user,
ipAddress: conn.RemoteAddr().String(),
accessToken: accessToken,
send: make(chan []byte, maxMessageSize),
send: make(chan []byte, 256),
UserAgent: userAgent,
ConnectedAt: time.Now(),
}

View File

@ -158,9 +158,9 @@ export default class Websocket {
var messages = e.data.split('\n');
for (var i = 0; i < messages.length; i++) {
try {
var model = JSON.parse(e.data);
var model = JSON.parse(messages[i]);
} catch (e) {
// console.log(e, e.data);
console.error(e, e.data);
return;
}