diff --git a/play.pokemonshowdown.com/src/client-connection.ts b/play.pokemonshowdown.com/src/client-connection.ts index 503db7f15f..7557b38d23 100644 --- a/play.pokemonshowdown.com/src/client-connection.ts +++ b/play.pokemonshowdown.com/src/client-connection.ts @@ -208,12 +208,15 @@ export class PSConnection { static connect() { if (PS.connection?.socket) return; PS.isOffline = false; + const isReconnecting = !!PS.connection; if (!PS.connection) { PS.connection = new PSConnection(); } else { PS.connection.reconnect(); } - PS.prefs.doAutojoin(); + if (!isReconnecting) { + PS.prefs.doAutojoin(); + } } } diff --git a/play.pokemonshowdown.com/src/panel-chat.tsx b/play.pokemonshowdown.com/src/panel-chat.tsx index 4869a7bc97..5a26158d32 100644 --- a/play.pokemonshowdown.com/src/panel-chat.tsx +++ b/play.pokemonshowdown.com/src/panel-chat.tsx @@ -176,24 +176,22 @@ export class ChatRoom extends PSRoom { } else { let lines = msg.split('\n'); - // cut off starting lines until we get to PS.lastMessage timestamp - // then cut off roomintro from the end let cutOffStart = 0; let cutOffEnd = lines.length; const cutOffTime = parseInt(PS.lastMessageTime); const cutOffExactLine = this.lastMessage ? '|' + this.lastMessage?.join('|') : ''; let reconnectMessage = '|raw|