Show a full reserve count on the Sokko TCG menu icon and remaining openings while opening a pack
A gold count now sits on the Sokko TCG menu icon while the opening reserve is full, so players notice it from any page. A light reserve route keeps it up to date outside the game, and the game page updates it with every state it gets. The opening stage also lists the remaining openings, apart for the automatic recharge and for openings bought one at a time, since the sidebar reserve is hidden there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2231bf05e1
commit
498e171bc3
14 changed files with 186 additions and 4 deletions
|
|
@ -278,6 +278,12 @@ export function createCardsApiHandler({
|
|||
return true;
|
||||
}
|
||||
|
||||
// Lue par le menu sur toutes les pages : un visiteur sans compte reçoit une réserve vide plutôt qu'une erreur.
|
||||
if (req.method === "GET" && url.pathname === "/api/cards/reserve") {
|
||||
json(res, 200, { recharge: session ? service.getReserve(session.player.id) : null });
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!session) throw Object.assign(new Error("Connectez-vous pour accéder à votre collection."), { status: 401, code: "AUTH_REQUIRED" });
|
||||
if (req.method !== "GET") {
|
||||
const origin = req.headers.origin;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue