Closed Sherlouk closed 7 years ago
Okay, moved username colors over to server-side. On next deploy, you'll see a node called user.username_color at GET /internal.
Also, for every chat_message in chat_messages at GET /internal you'll see each message having a username_color.
Also, for socket.on('chat_message_with_name'), the payload will have username_color as well.
There seems to be a bug in Swift 3 where the bitwise operator acts differently than JavaScript which means the "hash" function returns a different value ultimately throwing off the name colour logic.
Ideally the colour will be sent from the server to the client, allowing it to be synced Temporary fix may be to just not have coloured usernames and static colour for logged in users
The JavaScript code is as follows: