From fbd7d6be154b693e06c45fbb895ffa90ad65a8d5 Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Wed, 19 Oct 2022 21:15:18 +0100 Subject: [PATCH] shutup nextjs, thanks --- pages/overlay.js | 23 ++++++++++++++--------- src/components/Avatar.js | 2 +- src/components/SongInfo.js | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/pages/overlay.js b/pages/overlay.js index 293ea40..7e193a4 100644 --- a/pages/overlay.js +++ b/pages/overlay.js @@ -1,4 +1,4 @@ -import { Link } from "@nextui-org/react"; +import { Link, Spinner } from "@nextui-org/react"; import { Component } from "react"; import PlayerStats from "../src/components/PlayerStats"; import ScoreStats from "../src/components/ScoreStats"; @@ -309,14 +309,15 @@ export default class Overlay extends Component { }, scoreChanged: (data) => { const { status } = data; - const { score, currentMaxScore } = status.performance; - const percent = - currentMaxScore > 0 - ? (((score / currentMaxScore) * 1000) / 10).toFixed(2) - : 0.0; + const { score, relativeScore } = status.performance; + let finalScore = score; + if (finalScore == 0) { + finalScore = this.state.currentScore; + } + const percent = relativeScore * 100; this.setState({ - currentScore: score, - percentage: this.state.failed ? percent * 2 : percent + "%", + currentScore: finalScore, + percentage: percent.toFixed(2) + "%", }); }, noteFullyCut: (data) => { @@ -416,9 +417,13 @@ export default class Overlay extends Component { element.style.color = this.state.textColor; } + if (loadingPlayerData) { + return ; + } + return (
- {!isValidSteamId && !loadingPlayerData ? ( + {!isValidSteamId ? (

Invalid player, please visit the main page.

diff --git a/src/components/Avatar.js b/src/components/Avatar.js index 08becf3..1b47e4a 100644 --- a/src/components/Avatar.js +++ b/src/components/Avatar.js @@ -14,7 +14,7 @@ const Avatar = (props) => { loading="lazy" placeholder="blur" blurDataURL="https://cdn.fascinated.cc/IkQFyodbZv.jpg?raw=true" - unoptimized={true} + unoptimized={"true"} /> ); diff --git a/src/components/SongInfo.js b/src/components/SongInfo.js index 17fb3c1..428c8c5 100644 --- a/src/components/SongInfo.js +++ b/src/components/SongInfo.js @@ -73,7 +73,7 @@ export default class SongInfo extends Component { loading="lazy" placeholder="blur" blurDataURL="https://cdn.fascinated.cc/IkQFyodbZv.jpg?raw=true" - unoptimized={true} + unoptimized={"true"} />