feat: harmonisation charte OKI dark/light, command bar, local-first stats & SEO
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
import { fonduMesure, monteeMesure } from '$lib/motion/transitions';
|
||||
import { partager } from '$lib/partage';
|
||||
import { defi } from '$lib/stores/defi.svelte';
|
||||
import { ajouterPartie } from '$lib/stores/history.svelte';
|
||||
import type { Coordonnees, GuessResult, RoundPlace } from '$lib/types';
|
||||
|
||||
let { data } = $props();
|
||||
@@ -85,6 +86,21 @@
|
||||
if (!res.ok) throw new Error(String(res.status));
|
||||
result = (await res.json()) as GuessResult;
|
||||
defi.ajouter({ place, guess: skip ? null : guess, result });
|
||||
if (defi.termine) {
|
||||
ajouterPartie({
|
||||
mode: 'defi',
|
||||
region: 'TOUTES',
|
||||
scoreTotal: defi.total,
|
||||
roundsCount: defi.manches.length,
|
||||
rounds: defi.manches.map((m) => ({
|
||||
nom: m.result.nom,
|
||||
commune: m.result.commune,
|
||||
region: m.result.region,
|
||||
distanceKm: m.result.distanceKm,
|
||||
score: m.result.score
|
||||
}))
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
erreur = true;
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user