Add profile photo uploads and custom difficulty support
This commit is contained in:
@@ -18,7 +18,7 @@ export default async function DashboardPage() {
|
||||
? required(
|
||||
await admin()
|
||||
.from("game_sessions")
|
||||
.select("id,difficulty,created_at,current_round")
|
||||
.select("id,difficulty,difficulty_settings,created_at,current_round")
|
||||
.eq("owner_id", account.id)
|
||||
.gte("created_at", historyCutoff)
|
||||
.order("created_at", { ascending: false })
|
||||
@@ -52,7 +52,17 @@ export default async function DashboardPage() {
|
||||
<div className="draft-row" key={s.id}>
|
||||
<span>
|
||||
{formatDate(s.created_at)} ·{" "}
|
||||
{t(s.difficulty[0].toUpperCase() + s.difficulty.slice(1))}{" "}
|
||||
{s.difficulty_settings &&
|
||||
typeof s.difficulty_settings === "object" &&
|
||||
!Array.isArray(s.difficulty_settings) &&
|
||||
typeof s.difficulty_settings.name === "string"
|
||||
? ["easy", "normal", "hard"].includes(s.difficulty)
|
||||
? t(s.difficulty_settings.name)
|
||||
: s.difficulty_settings.name
|
||||
: t(
|
||||
s.difficulty[0].toUpperCase() +
|
||||
s.difficulty.slice(1),
|
||||
)}{" "}
|
||||
· {s.current_round}
|
||||
{t("/5 rounds")}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user