fix: accuracy 1000% bug, Spiele nav icon, light mode polish
Build & Deploy Tippspiel / build (push) Successful in 50s
Build & Deploy Tippspiel / build (push) Successful in 50s
- Backend: parseInt for leaderboard values from PostgreSQL (string concatenation "1"+"0"="10" caused 1000% accuracy) - BottomNav: Swords icon instead of emoji for Spiele tab - Light mode: stronger card shadows and shine gradient Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -101,24 +101,22 @@ router.get('/me', async (req: Request, res: Response): Promise<void> => {
|
||||
|
||||
const evaluatedCount = parseInt(tipsStats?.count ?? '0');
|
||||
const wrongCount = parseInt(tipsStats?.wrong_count ?? '0');
|
||||
const exactCount = parseInt(String(lb?.exact_count ?? '0'));
|
||||
const tendencyCount = parseInt(String(lb?.tendency_count ?? '0'));
|
||||
const accuracy =
|
||||
evaluatedCount > 0
|
||||
? Math.round(
|
||||
(((lb?.exact_count ?? 0) + (lb?.tendency_count ?? 0)) /
|
||||
evaluatedCount) *
|
||||
100
|
||||
)
|
||||
? Math.round(((exactCount + tendencyCount) / evaluatedCount) * 100)
|
||||
: 0;
|
||||
|
||||
const response: UserStatsResponse = {
|
||||
userId,
|
||||
fullName: lb?.full_name ?? req.staffbaseUser!.name ?? 'Unbekannt',
|
||||
team: lb?.team ?? null,
|
||||
totalPoints: lb?.total_points ?? 0,
|
||||
rank: lb?.rank ?? null,
|
||||
tipsCount: lb?.tips_count ?? 0,
|
||||
exactCount: lb?.exact_count ?? 0,
|
||||
tendencyCount: lb?.tendency_count ?? 0,
|
||||
totalPoints: parseInt(String(lb?.total_points ?? '0')),
|
||||
rank: lb?.rank ? parseInt(String(lb.rank)) : null,
|
||||
tipsCount: parseInt(String(lb?.tips_count ?? '0')),
|
||||
exactCount,
|
||||
tendencyCount,
|
||||
wrongCount,
|
||||
accuracy,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user