aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-12 10:30:39 +0100
committerlonkaars <l.leblansch@gmail.com>2021-03-12 10:30:39 +0100
commit73070f63128ef178bb15f64ebaf1c770cc40e5ce (patch)
tree4adfb1be4b2e4bc8bdd8131f4d001cf925b635ba
parent6a0411142a381389adc0d7151a76fbbb33a81fa2 (diff)
api error fix + recent games link to user
-rw-r--r--api/user/preferences.py2
-rw-r--r--components/recentGames.tsx7
2 files changed, 7 insertions, 2 deletions
diff --git a/api/user/preferences.py b/api/user/preferences.py
index bfbfe66..6c8a6f3 100644
--- a/api/user/preferences.py
+++ b/api/user/preferences.py
@@ -1,5 +1,5 @@
from flask import Blueprint, request
-from db import cursor
+from db import cursor, connection
from auth.login_token import token_login
import json
diff --git a/components/recentGames.tsx b/components/recentGames.tsx
index a37f662..4eaed91 100644
--- a/components/recentGames.tsx
+++ b/components/recentGames.tsx
@@ -53,7 +53,12 @@ export default function RecentGames(props: { games?: Array<gameInfo> }) {
</tr>
{
props.games?.map(game => <tr>
- <td style={LeftAlignedTableColumn}>{game.opponent?.username}</td>
+ <td style={LeftAlignedTableColumn}>
+ <a href={"/user?id=" + game.opponent?.id} style={{
+ textDecoration: "none",
+ fontWeight: 500
+ }}>{game.opponent?.username}</a>
+ </td>
<GameOutcome game={game}/>
<td>{Math.max(0, game.moves.length -1)}</td>
<td style={RightAlignedTableColumn}>{(() => {