saving udates, not missing much i guess

This commit is contained in:
jenzur
2019-07-14 02:28:16 +02:00
parent 9232830451
commit 3730230925
14 changed files with 537 additions and 134 deletions
+13 -3
View File
@@ -27,6 +27,7 @@ class Player extends React.Component {
mapTimes: [],
breakload: true,
scrollListener: {},
badgesTransfer: [],
};
this.scrollListener = this.handleScroll.bind(this);
}
@@ -36,8 +37,10 @@ class Player extends React.Component {
this.setState({ breakload: false })
const steamid = this.props.match.params.steamid;
const player = await Facade.getPlayerFromCache(steamid);
const badgesTransfer = await Facade.getPlayerBadgesFromCache(steamid);
const mapTimes = await Facade.getPlayerTimesFromCache(steamid, 0);
this.setState({ player });
this.setState({ badgesTransfer });
this.setState({ mapTimes });
this.setState({ breakload: true })
};
@@ -65,12 +68,20 @@ class Player extends React.Component {
loadMaps = async () => {
const steamid = this.props.match.params.steamid;
const mapTimes = await Facade.getPlayerTimesFromCache(steamid, this.state.mapTimes.length + 1);
const mapTimes = await Facade.getPlayerTimesFromCache(steamid, this.state.mapTimes.length);
this.setState({ mapTimes });
this.setState({ breakload: true })
}
render() {
const badges = Object.keys(this.state.badgesTransfer).map(badges => (
this.state.badgesTransfer[badges].map((badge) => {
return <div key={badge}>
<img src={badge} alt="" /> <br />
</div>
})
));
return (
<React.Fragment>
<div className="alert alert-primary" >
@@ -87,7 +98,6 @@ class Player extends React.Component {
</div>
</div>
</div>
<div className="container mm" style={{ marginTop: "85px" }}>
<div style={{
position: 'absolute', left: '50%', top: '30%'
@@ -100,6 +110,7 @@ class Player extends React.Component {
<strong className="col-lg-1 col-centered" />Rank: {this.state.player.Rank}<br />
<strong className="col-lg-1 col-centered" />Points: {this.state.player.PlayerPoints}<br />
<strong className="col-lg-1 col-centered" />Times: {this.state.player.Times}<br />
{badges}
<br />
<br />
</a>
@@ -119,7 +130,6 @@ class Player extends React.Component {
{!this.state.breakload ? <h1>
Loading Stats <br /> <br /> <LoadingIndicator />
</h1> : ""}
</div>
</div>
</div>