From adb2d86f0bc5e82ee983795122245974998843a7 Mon Sep 17 00:00:00 2001 From: adevopg Date: Tue, 14 Jul 2026 14:57:30 +0000 Subject: [PATCH] select-account: mostrar WOW1/WOW2/WOW3 en vez de 15#1/15#2/15#3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El selector de cuentas de juego listaba el nombre interno (15#1). Ahora usa wowAccountLabel (mismo criterio que my-account/cabecera): «15#1» → «WOW1». La etiqueta se calcula en el Server Component (bnet.ts importa crypto, no vale en cliente) y se pasa al formulario. Co-Authored-By: Claude Opus 4.8 (1M context) --- web-next/app/[locale]/select-account/SelectAccountForm.tsx | 3 ++- web-next/app/[locale]/select-account/page.tsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web-next/app/[locale]/select-account/SelectAccountForm.tsx b/web-next/app/[locale]/select-account/SelectAccountForm.tsx index 95e730f..0eb5ea1 100644 --- a/web-next/app/[locale]/select-account/SelectAccountForm.tsx +++ b/web-next/app/[locale]/select-account/SelectAccountForm.tsx @@ -6,6 +6,7 @@ import { useTranslations, useLocale } from 'next-intl' interface GameAccount { id: number username: string + label: string // nombre visible: «15#1» → «WOW1» } export function SelectAccountForm({ accounts }: { accounts: GameAccount[] }) { @@ -50,7 +51,7 @@ export function SelectAccountForm({ accounts }: { accounts: GameAccount[] }) { disabled={busy !== null} className="login-button" > - {busy === a.id ? t('entering') : a.username} + {busy === a.id ? t('entering') : a.label} diff --git a/web-next/app/[locale]/select-account/page.tsx b/web-next/app/[locale]/select-account/page.tsx index fd356d8..6f46069 100644 --- a/web-next/app/[locale]/select-account/page.tsx +++ b/web-next/app/[locale]/select-account/page.tsx @@ -2,6 +2,7 @@ import { getTranslations, setRequestLocale } from 'next-intl/server' import { redirect } from '@/i18n/navigation' import { getSession } from '@/lib/session' import { getGameAccounts } from '@/lib/auth' +import { wowAccountLabel } from '@/lib/bnet' import { PageShell } from '@/components/PageShell' import { SelectAccountForm } from './SelectAccountForm' @@ -15,7 +16,8 @@ export default async function SelectAccountPage({ params }: { params: Promise<{ const session = await getSession() if (!session.bnetId) redirect({ href: '/login', locale }) - const games = await getGameAccounts(session.bnetId!) + // Etiqueta visible «15#1» → «WOW1» (mismo criterio que my-account/cabecera). + const games = (await getGameAccounts(session.bnetId!)).map((g) => ({ ...g, label: wowAccountLabel(g.username) })) // Autoseleccionar si solo hay una if (games.length === 1) { // La selección real la hace el cliente/route; aquí mostramos el formulario igual,