Skip to content

Instantly share code, notes, and snippets.

@sminnee
Created October 5, 2021 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sminnee/74e991fd8233232d74c204b0fee6e305 to your computer and use it in GitHub Desktop.
Save sminnee/74e991fd8233232d74c204b0fee6e305 to your computer and use it in GitHub Desktop.
diff --git a/src/connector.ts b/src/connector.ts
index c0aeaab0..2f0ecc99 100644
--- a/src/connector.ts
+++ b/src/connector.ts
@@ -70,9 +70,7 @@ export default class Connector extends SocketClient {
onLogin = () => {
console.log('app.on login reconnect')
- if (this.multiplayerActive) {
- this.reconnect()
- }
+ this.reconnect()
this.grid.reconnect()
}
@@ -93,6 +91,12 @@ export default class Connector extends SocketClient {
this.connect()
}
+ reconnect() {
+ if (this.multiplayerActive) {
+ super.reconnect()
+ }
+ }
+
get name() {
return this.persona.user ? this.persona.user.name : 'anon'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment