Skip to content

Commit

Permalink
Fix bug sending empty join message.
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Nov 20, 2022
1 parent 49ae5c4 commit b530855
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/screens/chat/packetHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,10 @@ export const packetHandler =
if (statusRef.current === 'CONNECTING' && connection.loggedIn) {
setLoading('')
statusRef.current = 'CONNECTED'
if (sendJoinMessage) {
const joinMessageToSend = joinMessage.substring(0, charLimit).trim()
if (sendJoinMessage && joinMessageToSend) {
connection
.writePacket(
0x03,
concatPacketData([joinMessage.substring(0, charLimit)])
)
.writePacket(0x03, concatPacketData([joinMessageToSend]))
.catch(handleError(addMessage, sendMessageError))
}
if (sendSpawnCommand) {
Expand Down

0 comments on commit b530855

Please sign in to comment.