From 2acc48b3c45ad2ba5c0e1b5214462a3f7d15e077 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 29 Nov 2025 17:42:44 -0800 Subject: [PATCH] add reactivity to Party.svelte for query refetches --- src/lib/components/party/Party.svelte | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/components/party/Party.svelte b/src/lib/components/party/Party.svelte index 0c72ea16..29fe9e06 100644 --- a/src/lib/components/party/Party.svelte +++ b/src/lib/components/party/Party.svelte @@ -80,6 +80,15 @@ let party = $state( initial?.id && initial?.id !== 'new' && Array.isArray(initial?.weapons) ? initial : defaultParty ) + + // Sync local party state with prop changes (for query refetches) + $effect(() => { + // Only update if we have valid party data from props + if (initial && initial.id && initial.id !== 'new' && Array.isArray(initial.weapons)) { + party = initial + } + }) + let activeTab = $state(GridType.Weapon) let loading = $state(false) let error = $state(null)