Skip to content

Commit

Permalink
use bind:value={sortBy}
Browse files Browse the repository at this point in the history
  • Loading branch information
Not-a-cowfr committed Jan 15, 2025
1 parent 6f1b912 commit c5436ff
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/components/stats/jacob/crop-stats.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
crop?: string;
}
let { jacob, crop: initalCrop = 'Wheat' }: Props = $props();
let { jacob, crop: initialCrop = 'Wheat' }: Props = $props();
const contestsByCrop = $derived(
jacob?.contests?.reduce<Record<string, components['schemas']['ContestParticipationDto'][]>>((acc, contest) => {
Expand Down Expand Up @@ -76,8 +76,8 @@
});
type ReducedCropStats = {
participations: number;
firstPlaceScores: number;
participations: 0;
firstPlaceScores: 0;
medals: Record<(typeof MEDAL_TYPES)[number], number>;
};
Expand Down Expand Up @@ -109,8 +109,8 @@
);
onMount(() => {
if (initalCrop) {
selectedCrops.set({ ...DEFAULT_SELECTED_CROPS, [initalCrop]: true });
if (initialCrop) {
selectedCrops.set({ ...DEFAULT_SELECTED_CROPS, [initialCrop]: true });
}
});
</script>
Expand Down Expand Up @@ -141,10 +141,7 @@
<p class="text-md mb-1 leading-none">Sort By</p>
<Select.Simple
class="md:w-48"
value={sortBy}
change={(value) => {
sortBy = value ?? 'recent';
}}
bind:value={sortBy}
options={[
{
value: 'recent',
Expand Down

0 comments on commit c5436ff

Please sign in to comment.