mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2024-11-22 12:16:21 +03:00
Changed var to let, updated promise check
This commit is contained in:
parent
874ed6eedc
commit
4815924279
1 changed files with 4 additions and 6 deletions
|
@ -45,10 +45,10 @@ class Handler {
|
|||
|
||||
const _request = this.baseRequest(url);
|
||||
|
||||
var received_bytes = 0;
|
||||
var total_bytes = 0;
|
||||
let received_bytes = 0;
|
||||
let total_bytes = 0;
|
||||
|
||||
_request.on('response', function (data) {
|
||||
_request.on('response', (data) => {
|
||||
total_bytes = parseInt(data.headers['content-length']);
|
||||
});
|
||||
|
||||
|
@ -463,9 +463,7 @@ class Handler {
|
|||
const minArgs = this.options.overrides.minArgs || 5;
|
||||
if(args.length < minArgs) args = args.concat(this.version.minecraftArguments ? this.version.minecraftArguments.split(' ') : this.version.arguments.game);
|
||||
|
||||
if({}.toString.call(this.options.authorization) === "[object Promise]") {
|
||||
this.options.authorization = await this.options.authorization;
|
||||
}
|
||||
this.options.authorization = await Promise.resolve(this.options.authorization);
|
||||
|
||||
const fields = {
|
||||
'${auth_access_token}': this.options.authorization.access_token,
|
||||
|
|
Loading…
Add table
Reference in a new issue