remove empty squads from army view; replace window.scroll with window.scrollTo()
parent
e2d522ac7c
commit
fcae4d57cd
|
@ -67,6 +67,9 @@ overview.route('/')
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do not return empty squads
|
||||||
|
if (squadMembers.length > 0) {
|
||||||
const s = squad.toObject();
|
const s = squad.toObject();
|
||||||
s.members = squadMembers;
|
s.members = squadMembers;
|
||||||
s.memberCount = squadMembers.length;
|
s.memberCount = squadMembers.length;
|
||||||
|
@ -80,6 +83,8 @@ overview.route('/')
|
||||||
armyOverview.OPFOR.squads.push(s);
|
armyOverview.OPFOR.squads.push(s);
|
||||||
countOpfor += s.members.length;
|
countOpfor += s.members.length;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -66,7 +66,7 @@ export class WarDetailComponent {
|
||||||
this.fractionStatsInitialized = true;
|
this.fractionStatsInitialized = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
window.scroll({left: 0, top: 0, behavior: 'smooth'});
|
window.scrollTo({left: 0, top: 0, behavior: 'smooth'});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue