diff --git a/src/lib/components/DevButtons.svelte b/src/lib/components/DevButtons.svelte index 15210c1..8770feb 100644 --- a/src/lib/components/DevButtons.svelte +++ b/src/lib/components/DevButtons.svelte @@ -2,6 +2,30 @@ import { browser } from "$app/environment"; import Button from "$lib/components/Button.svelte"; + let { anonymousId }: { anonymousId: string | null } = $props(); + + let seeding = $state(false); + + async function seedHistory() { + if (!browser || !anonymousId || seeding) return; + seeding = true; + try { + const response = await fetch("/api/dev/seed-history", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ anonymousId }) + }); + const result = await response.json(); + alert( + `Seeded! Inserted: ${result.inserted?.join(", ")}. Skipped (already exist): ${result.skipped?.join(", ") || "none"}` + ); + } catch { + alert("Failed to seed history"); + } finally { + seeding = false; + } + } + function clearLocalStorage() { if (!browser) return; // Clear all bibdle-related localStorage items @@ -86,4 +110,13 @@ > Clear LocalStorage + + diff --git a/src/lib/components/GuessesTable.svelte b/src/lib/components/GuessesTable.svelte index a5103e1..b1d36a3 100644 --- a/src/lib/components/GuessesTable.svelte +++ b/src/lib/components/GuessesTable.svelte @@ -71,8 +71,7 @@
Guess what book of the bible you think the verse is from. You will - get clues to tell you if your guess is close or not. Green means the - category is correct; red means wrong. + get clues to help you after each guess.
{:else} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index abb2039..142e097 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -413,18 +413,31 @@