Azzera errori di lint e di tipo e corregge il test sugli slot della rosa
- schema-profili: il test pretendeva che lo slot g1 fosse libero, ma in produzione è collegato a un giocatore vero; ora verifica che il tentativo anonimo non cambi il valore. - rosa: il default dei voti MVP era fuori da useMemo e faceva ricalcolare la rosa a ogni render finché i voti non erano caricati. - test dei badge, profili-core, push-sw, scout-stato: tipi allineati al codice (MappaPresenze, nascita da M18, renotify, narrowing di deepEqual). - vite.config: tipizzato come UserConfig e rimosso esbuild.keepNames, ignorato da Vite 8 che non usa più esbuild. - formattazione Prettier in BarraSottosezioni e classifica. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
61d4dacb3a
commit
431530af2a
13 files changed
+56
-44
No files matched your search
@@ -19,6 +19,8 @@ import { daRiga, type RigaEvento, type Evento } from "@/lib/eventi";
|
||||
import { giocatori, type Giocatore } from "@/lib/crapp-data";
|
||||
import { statoLocale } from "../helpers/locale";
|
||||
import { prova, riepilogo, salta } from "../helpers/prova";
|
||||
import type { Stato } from "@/lib/crapp-data";
|
||||
import type { MappaPresenze } from "@/lib/presenze";
|
||||
|
||||
const locale = statoLocale();
|
||||
|
||||
@@ -90,7 +92,7 @@ if (!locale) {
|
||||
}
|
||||
|
||||
async function leggiPresenzeETempi(): Promise<{
|
||||
presenze: Record<string, Record<string, string>>;
|
||||
presenze: MappaPresenze;
|
||||
tempi: Record<string, Record<string, string>>;
|
||||
}> {
|
||||
const res = await rest(
|
||||
@@ -99,10 +101,10 @@ if (!locale) {
|
||||
const righe = (await res.json()) as Array<{
|
||||
evento_id: string;
|
||||
giocatore_id: string;
|
||||
stato: string;
|
||||
stato: Stato;
|
||||
risposto_il: string;
|
||||
}>;
|
||||
const presenze: Record<string, Record<string, string>> = {};
|
||||
const presenze: MappaPresenze = {};
|
||||
const tempi: Record<string, Record<string, string>> = {};
|
||||
for (const r of righe) {
|
||||
(presenze[r.evento_id] ??= {})[r.giocatore_id] = r.stato;
|
||||
|
||||
Reference in new issue
Block a user