🐞 fix(排行榜): 登录超时后排行榜中不再显示
This commit is contained in:
@@ -667,6 +667,7 @@ export class Rank {
|
|||||||
|
|
||||||
public async getRankListWithMyRank(myId: myIdInter, isReverse = true) {
|
public async getRankListWithMyRank(myId: myIdInter, isReverse = true) {
|
||||||
let ranks = await this.getRankByRange('+inf', '-inf', isReverse);
|
let ranks = await this.getRankByRange('+inf', '-inf', isReverse);
|
||||||
|
console.log('#### ranks', ranks);
|
||||||
let newRanks = [], newMyRank: any;
|
let newRanks = [], newMyRank: any;
|
||||||
let myRank = ranks.find(cur => {
|
let myRank = ranks.find(cur => {
|
||||||
return cur.isMyInfo(myId);
|
return cur.isMyInfo(myId);
|
||||||
@@ -674,7 +675,7 @@ export class Rank {
|
|||||||
if (this.generFields) {
|
if (this.generFields) {
|
||||||
for (let rank of ranks) {
|
for (let rank of ranks) {
|
||||||
let n = await this.generFields(rank);
|
let n = await this.generFields(rank);
|
||||||
newRanks.push(n);
|
if(n) newRanks.push(n);
|
||||||
}
|
}
|
||||||
if (myRank) {
|
if (myRank) {
|
||||||
newMyRank = await this.generFields(myRank);
|
newMyRank = await this.generFields(myRank);
|
||||||
@@ -737,9 +738,12 @@ export class Rank {
|
|||||||
let raws = await this.getRankByRangeRaw(max, min, isReverse);
|
let raws = await this.getRankByRangeRaw(max, min, isReverse);
|
||||||
|
|
||||||
let ranks = new Array<RoleRankInfo | GuildRankInfo>();
|
let ranks = new Array<RoleRankInfo | GuildRankInfo>();
|
||||||
for (let { rank, field, scores } of raws) {
|
let l = 1;
|
||||||
let param = await this.getParam(rank, field, scores);
|
for (let { field, scores } of raws) {
|
||||||
if(param) ranks.push(param);
|
let param = await this.getParam(l, field, scores);
|
||||||
|
if(param) {
|
||||||
|
ranks.push(param); l++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ranks
|
return ranks
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user