Fixed the match history bug

Fixed a match history bug that was reversing match results
This commit is contained in:
MaciejkaG 2024-04-07 00:56:13 +02:00
parent 1bd84bee09
commit f6f5af9758
2 changed files with 5 additions and 5 deletions

View File

@ -8,6 +8,10 @@
justify-content: center; justify-content: center;
text-align: center; text-align: center;
} }
#profileView .matchList .match {
height: 7rem;
}
} }
@media only screen and (max-width: 820px) { @media only screen and (max-width: 820px) {
@ -31,10 +35,6 @@
width: 90vw; width: 90vw;
} }
#profileView .matchList .match {
height: 7rem;
}
#profileView .match div { #profileView .match div {
flex-direction: column; flex-direction: column;
} }

View File

@ -198,7 +198,7 @@ export class MailAuth {
const conn = mysql.createConnection(this.mysqlOptions); const conn = mysql.createConnection(this.mysqlOptions);
conn.query(`INSERT INTO matches(match_id, match_type, host_id, guest_id, duration) VALUES (${conn.escape(matchId)}, ${conn.escape(type)}, ${conn.escape(hostId)}, ${conn.escape(guestId)}, ${conn.escape(duration)})`, async (error) => { conn.query(`INSERT INTO matches(match_id, match_type, host_id, guest_id, duration) VALUES (${conn.escape(matchId)}, ${conn.escape(type)}, ${conn.escape(hostId)}, ${conn.escape(guestId)}, ${conn.escape(duration)})`, async (error) => {
if (error) reject(error); if (error) reject(error);
else conn.query(`INSERT INTO statistics(match_id, user_id, board, won) VALUES (${conn.escape(matchId)}, ${conn.escape(hostId)}, ${conn.escape(JSON.stringify(boards[0]))}, ${conn.escape(winnerIdx ? 0 : 1)}), (${conn.escape(matchId)}, ${conn.escape(guestId)}, ${conn.escape(JSON.stringify(boards[1]))}, ${conn.escape(winnerIdx ? 1 : 0)})`, async (error, response) => { else conn.query(`INSERT INTO statistics(match_id, user_id, board, won) VALUES (${conn.escape(matchId)}, ${conn.escape(hostId)}, ${conn.escape(JSON.stringify(boards[0]))}, ${conn.escape(winnerIdx ? 1 : 0)}), (${conn.escape(matchId)}, ${conn.escape(guestId)}, ${conn.escape(JSON.stringify(boards[1]))}, ${conn.escape(winnerIdx ? 0 : 1)})`, async (error, response) => {
if (error) reject(error); if (error) reject(error);
else resolve(); else resolve();
}); });