fix weapons collection crash at page 6

use index key instead of weapon.id to avoid svelte 5 keyed each bug at 250+ items
This commit is contained in:
Justin Edmund 2025-12-20 17:11:39 -08:00
parent f47770dbfb
commit 8a07691c0b

View file

@ -152,7 +152,7 @@
</div> </div>
{:else if currentViewMode === 'grid'} {:else if currentViewMode === 'grid'}
<div class="weapon-grid"> <div class="weapon-grid">
{#each allWeapons as weapon (weapon.id)} {#each allWeapons as weapon, i (i)}
<SelectableCollectionCard id={weapon.id} onClick={() => openWeaponDetails(weapon)}> <SelectableCollectionCard id={weapon.id} onClick={() => openWeaponDetails(weapon)}>
<CollectionWeaponCard {weapon} /> <CollectionWeaponCard {weapon} />
</SelectableCollectionCard> </SelectableCollectionCard>
@ -160,7 +160,7 @@
</div> </div>
{:else} {:else}
<div class="weapon-list"> <div class="weapon-list">
{#each allWeapons as weapon (weapon.id)} {#each allWeapons as weapon, i (i)}
<SelectableCollectionRow id={weapon.id} onClick={() => openWeaponDetails(weapon)}> <SelectableCollectionRow id={weapon.id} onClick={() => openWeaponDetails(weapon)}>
<CollectionWeaponRow {weapon} /> <CollectionWeaponRow {weapon} />
</SelectableCollectionRow> </SelectableCollectionRow>