From 6c5f0b160e9d3876504db166411500e3c2c059d2 Mon Sep 17 00:00:00 2001 From: feco Date: Sun, 22 Nov 2026 11:31:15 +0000 Subject: [PATCH] Tarot: a reading being written stays on the table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opening the page while a reading is written shows that reading (cards and progress), not the form for a new one; the 'Új jóslás' button appears only once the reading is finished. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL --- .../src/components/tarot/TarotTable.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/services/frontend/src/components/tarot/TarotTable.tsx b/services/frontend/src/components/tarot/TarotTable.tsx index 102ecff..6ec3f0f 100644 --- a/services/frontend/src/components/tarot/TarotTable.tsx +++ b/services/frontend/src/components/tarot/TarotTable.tsx @@ -50,10 +50,12 @@ export function TarotTable({ const [spread, setSpread] = useState("trinity"); const [topic, setTopic] = useState("general"); const [question, setQuestion] = useState(""); - const [phase, setPhase] = useState("setup"); + // A reading still being written is shown on the table, not the form for a new one. + const inProgress = initialReadings.find((r) => r.status === "pending" || r.status === "running") ?? null; + const [phase, setPhase] = useState(inProgress ? "done" : "setup"); const [picked, setPicked] = useState([]); - const [current, setCurrent] = useState(null); - const [revealed, setRevealed] = useState(0); + const [current, setCurrent] = useState(inProgress); + const [revealed, setRevealed] = useState(inProgress?.cards.length ?? 0); const [error, setError] = useState(null); const [buying, setBuying] = useState(false); @@ -243,7 +245,9 @@ export function TarotTable({ ? "A lapok…" : "A kirakásod"} - {question.trim() &&

„{question.trim()}”

} + {(current ? current.question : question.trim()) && ( +

„{current ? current.question : question.trim()}”

+ )}

{phase === "picking" && `Hangolódj a kérdésedre, és válassz ösztönösen. ${picked.length}/${chosen.cards}`} @@ -265,9 +269,11 @@ export function TarotTable({ <>

- + {!writing && ( + + )} Külön oldalon