oops
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 47s
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m19s

This commit is contained in:
Lee 2024-10-28 16:30:12 +00:00
parent 1c2214a659
commit 0ec1fc9d41
4 changed files with 15 additions and 2 deletions

@ -708,6 +708,7 @@ export class ScoreService {
pp: previousScore.pp,
weight: previousScore.weight,
maxCombo: previousScore.maxCombo,
timestamp: previousScore.timestamp,
change: {
score: score.score - previousScore.score,
accuracy: score.accuracy - previousScore.accuracy,

@ -35,4 +35,9 @@ export type PreviousScore = {
* The full combo of the previous score.
*/
fullCombo?: boolean;
/**
* When the previous score was set.
*/
timestamp: Date;
};

@ -5,6 +5,7 @@ import { getPageFromRank } from "@ssr/common/utils/utils";
import { ScoreSaberScore } from "@ssr/common/model/score/impl/scoresaber-score";
import ScoreSaberLeaderboard from "@ssr/common/model/leaderboard/impl/scoresaber-leaderboard";
import { ScoreTimeSet } from "@/components/score/score-time-set";
import { timeAgo } from "@ssr/common/utils/time-utils";
type Props = {
score: ScoreSaberScore;
@ -23,6 +24,12 @@ export default function ScoreRankInfo({ score, leaderboard }: Props) {
</Link>
</div>
<ScoreTimeSet score={score} />
{score.previousScore?.timestamp && (
<div className="text-xs text-gray-400 flex flex-row gap-2 items-center">
<p>vs</p>
<p>{timeAgo(new Date(score.previousScore.timestamp))}</p>
</div>
)}
</div>
);
}

@ -124,8 +124,8 @@ export default function Score({ leaderboard, beatSaverMap, score, settings, high
: "grid-cols-[20px 1fr_1fr] lg:grid-cols-[0.5fr_4fr_1fr_350px]"; // Original with buttons
return (
<div className="pb-2 pt-2 w-full h-full">
<div className={`grid w-full h-full gap-2 lg:gap-0 ${gridColsClass}`}>
<div className="pb-2 pt-2">
<div className={`grid w-full gap-2 lg:gap-0 ${gridColsClass}`}>
<ScoreRankInfo score={score} leaderboard={leaderboard} />
<ScoreSongInfo leaderboard={leaderboard} beatSaverMap={beatSaverMap} />
{!settings?.noScoreButtons && (