fixed pong game history color issue

This commit is contained in:
Maix0 2026-01-15 16:19:23 +01:00 committed by Nigel
parent 17f0595b2f
commit 496063def9

View file

@ -20,6 +20,7 @@ async function pongHistory(_url: string, args: RouteHandlerParams): Promise<Rout
if (isNullish(user)) { if (isNullish(user)) {
return { html: '<span> You aren\'t logged in </span>', postInsert: () => { showError("You must be logged in !"); navigateTo("/") } }; return { html: '<span> You aren\'t logged in </span>', postInsert: () => { showError("You must be logged in !"); navigateTo("/") } };
} }
let targetUserId = args.userid !== 'me' ? args.userid : user.id;
let userInfoRes = await client.getUser({ user: args.userid }); let userInfoRes = await client.getUser({ user: args.userid });
if (userInfoRes.kind !== 'success') { if (userInfoRes.kind !== 'success') {
@ -43,9 +44,9 @@ async function pongHistory(_url: string, args: RouteHandlerParams): Promise<Rout
if (!g.local) { if (!g.local) {
let youwin = false; let youwin = false;
if (g.left.id === user.id && g.outcome === 'winL') if (g.left.id === targetUserId && g.outcome === 'winL')
youwin = true; youwin = true;
else if (g.right.id === user.id && g.outcome === 'winR') else if (g.right.id === targetUserId && g.outcome === 'winR')
youwin = true; youwin = true;
if (youwin) if (youwin)