diff --git a/src/lib/components/pokedex/PokedexEntryCatchRecord.svelte b/src/lib/components/pokedex/PokedexEntryCatchRecord.svelte index 75a4dd4..fc2a44a 100644 --- a/src/lib/components/pokedex/PokedexEntryCatchRecord.svelte +++ b/src/lib/components/pokedex/PokedexEntryCatchRecord.svelte @@ -32,6 +32,24 @@ function updateCatchRecord() { dispatch('updateCatch', { pokedexEntry, catchRecord }); } + + function onCaughtChange() { + if (!catchRecord) return; + // Mutually exclusive with "needs to evolve" + if (catchRecord.caught) { + catchRecord.haveToEvolve = false; + } + updateCatchRecord(); + } + + function onNeedsToEvolveChange() { + if (!catchRecord) return; + // Mutually exclusive with "caught" + if (catchRecord.haveToEvolve) { + catchRecord.caught = false; + } + updateCatchRecord(); + }
@@ -97,7 +115,7 @@ type="checkbox" bind:checked={catchRecord.haveToEvolve} class="checkbox checkbox-primary border-black" - on:change={updateCatchRecord} + on:change={onNeedsToEvolveChange} /> @@ -105,7 +123,7 @@