Fixing steamId not beeing set properly so hive id could not be retrieved

This commit is contained in:
Absurdon 2018-04-14 13:24:05 +02:00
parent 0a956b80bd
commit a7da403571
2 changed files with 3 additions and 6 deletions

View file

@ -88,10 +88,7 @@ const StatAttributes = {
} }
}; };
function UserStatisticsWrapper (apiResponse) { function UserStatisticsWrapper (apiResponse = {}) {
if(apiResponse === undefined) {
apiResponse = {};
}
for (let attr in StatAttributes) { for (let attr in StatAttributes) {
let adapter = StatAttributes[attr]; let adapter = StatAttributes[attr];
this[attr] = apiResponse[adapter.v1] || this[attr] = apiResponse[adapter.v1] ||

View file

@ -26,7 +26,7 @@ function User (user) {
this.bans = user['bans']; this.bans = user['bans'];
if (user['steam']) { if (user['steam']) {
this.steam = { this.steam = {
id: user['steam']['id'] || null, id: user['steam']['id'] || this.getSteamId(),
url: user['steam']['url'] || null, url: user['steam']['url'] || null,
nickname: user['steam']['nickname'] || null nickname: user['steam']['nickname'] || null
}; };
@ -42,7 +42,7 @@ function User (user) {
id: null id: null
}; };
if (this.steam.url) { if (this.steam.id) {
this.hive.id = this.getHiveId(); this.hive.id = this.getHiveId();
} }
} }