Skip to content

Commit

Permalink
make connect better for end users
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek committed Nov 17, 2016
1 parent 83da2f5 commit 5156624
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/RPCClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class RPCClient {
this.rest = new RESTClient(this);
}

connect (tries = 0, accessToken = this.accessToken) {
connect (accessToken = this.accessToken, tries = 0) {
if (this.connected) {
return;
}
Expand Down Expand Up @@ -197,7 +197,7 @@ class RPCClient {
try {
this.socket.close();
} catch (e) {}
setTimeout(() => this.connect(e.code === 1006 ? ++this.connectionTries : 0), 250);
setTimeout(() => this.connect(null, e.code === 1006 ? ++this.connectionTries : 0), 250);
}

_handleMessage (message) {
Expand Down

0 comments on commit 5156624

Please sign in to comment.