Clean up some stuff

This commit is contained in:
Schuyler Cebulskie
2016-09-19 04:32:24 -04:00
parent 6ede7a32fd
commit 6a94658dd7
7 changed files with 83 additions and 57 deletions

View File

@@ -13,9 +13,15 @@ class RESTMethods {
this.rest = restManager;
}
loginToken(token) {
return new Promise((resolve, reject) => {
this.rest.client.manager.connectToWebSocket(token, resolve, reject);
});
}
loginEmailPassword(email, password) {
return new Promise((resolve, reject) => {
this.rest.client.emit('debug', 'Client launched using email and password - should use token instead');
this.rest.client.emit('warn', 'Client launched using email and password - should use token instead');
this.rest.client.email = email;
this.rest.client.password = password;
this.rest.makeRequest('post', Constants.Endpoints.login, false, { email, password })
@@ -26,12 +32,6 @@ class RESTMethods {
});
}
loginToken(token) {
return new Promise((resolve, reject) => {
this.rest.client.manager.connectToWebSocket(token, resolve, reject);
});
}
logout() {
return this.rest.makeRequest('post', Constants.Endpoints.logout, true);
}

View File

@@ -1,7 +1,6 @@
const RequestHandler = require('./RequestHandler');
class BurstRequestHandler extends RequestHandler {
constructor(restManager, endpoint) {
super(restManager, endpoint);
this.requestRemaining = 1;
@@ -58,7 +57,6 @@ class BurstRequestHandler extends RequestHandler {
});
}
handle() {
super.handle();
if (this.requestRemaining < 1 || this.queue.length === 0 || this.globalLimit) return;
@@ -67,7 +65,6 @@ class BurstRequestHandler extends RequestHandler {
this.requestRemaining--;
}
}
}
module.exports = BurstRequestHandler;