+ {#if catchRecord?.caught}
+
+
+ Caught
+
+ {:else if catchRecord?.haveToEvolve}
+
+
+ Caught but needs to evolve
+
+ {/if}
{#if catchRecord?.inHome}
+
+
In HOME
+
{/if}
-
-
ⓘ
+
@@ -104,7 +293,8 @@
{pokedexEntry.pokedexNumber.toString().padStart(3, '0')}
Caught: {catchRecord?.caught ? 'Yes' : 'No'}
- Needs to Evolve: {catchRecord?.haveToEvolve ? 'Yes' : 'No'}
+ Caught but needs to Evolve: {catchRecord?.haveToEvolve ? 'Yes' : 'No'}
+
In Home: {catchRecord?.inHome ? 'Yes' : 'No'}
@@ -142,8 +332,73 @@
From 35ee92df0ccda8aba15e5a887852422bd12be762 Mon Sep 17 00:00:00 2001
From: Josh Creek <8179928+jcreek@users.noreply.github.com>
Date: Fri, 9 Jan 2026 20:51:33 +0000
Subject: [PATCH 2/2] fix(#63): Enforce mutually exclusive catch states
---
.../pokedex/PokedexEntryCatchRecord.svelte | 22 +++++++++++++++++--
src/routes/pokedex/[id]/+page.svelte | 10 ++++++++-
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/lib/components/pokedex/PokedexEntryCatchRecord.svelte b/src/lib/components/pokedex/PokedexEntryCatchRecord.svelte
index 100d447..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}
/>