Player values update on song finish now

This commit is contained in:
Liam 2022-10-10 09:17:19 +01:00
parent 5215d590c0
commit 1638acac7d

@ -105,13 +105,7 @@ export default class Home extends Component {
setTimeout(async () => { setTimeout(async () => {
await this.updateData(id); await this.updateData(id);
}, 10); }, 10); // 10ms
setTimeout(async () => {
if (!this.state.isValidSteamId) {
return;
}
await this.updateData(id);
}, 30_000); // Update the player data every 30 seconds.
let shouldConnectSocket = false; let shouldConnectSocket = false;
@ -188,8 +182,11 @@ export default class Home extends Component {
* *
* @param {boolean} visible Whether to show info other than the player stats * @param {boolean} visible Whether to show info other than the player stats
*/ */
resetData(visible) { async resetData(visible) {
console.log("Exiting level, resetting data.") console.log("Exiting level, resetting data.")
setTimeout(async () => {
await this.updateData(id);
}, 250);
this.setState({ this.setState({
leftHand: { leftHand: {
averageCut: [15.00], averageCut: [15.00],
@ -276,7 +273,6 @@ export default class Home extends Component {
this.setBeatSaver(data.status.beatmap); this.setBeatSaver(data.status.beatmap);
}, },
"finished": () => { "finished": () => {
console.log("Exiting level, resetting data.")
this.resetData(false); this.resetData(false);
}, },
"softFail": () => { "softFail": () => {
@ -289,7 +285,6 @@ export default class Home extends Component {
this.setState({ paused: false }); this.setState({ paused: false });
}, },
"menu": () => { "menu": () => {
console.log("Exiting level, resetting data.")
this.resetData(false); this.resetData(false);
}, },
"noteCut": () => {}, "noteCut": () => {},