mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
Fix bug of unknown trophy
This commit is contained in:
parent
66eeb53973
commit
32e060a721
2 changed files with 4 additions and 1 deletions
|
|
@ -39,6 +39,9 @@ export class Trophy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private calculateNextRankPercentage() {
|
private calculateNextRankPercentage() {
|
||||||
|
if (this.rank === RANK.UNKNOWN) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
const nextRankIndex = RANK_ORDER.indexOf(this.rank) - 1;
|
const nextRankIndex = RANK_ORDER.indexOf(this.rank) - 1;
|
||||||
// When got the max rank
|
// When got the max rank
|
||||||
if (nextRankIndex < 0 || this.rank === RANK.SSS) {
|
if (nextRankIndex < 0 || this.rank === RANK.SSS) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export function parseParams(req: ServerRequest): URLSearchParams {
|
||||||
|
|
||||||
export function abridgeScore(score: number): string {
|
export function abridgeScore(score: number): string {
|
||||||
if (Math.abs(score) < 1) {
|
if (Math.abs(score) < 1) {
|
||||||
return "unknown";
|
return "0pt";
|
||||||
}
|
}
|
||||||
if (Math.abs(score) > 999) {
|
if (Math.abs(score) > 999) {
|
||||||
return (Math.sign(score) * (Math.abs(score) / 1000)).toFixed(1) + "pt";
|
return (Math.sign(score) * (Math.abs(score) / 1000)).toFixed(1) + "pt";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue