diff --git a/src/lib/components/cards/RacePickCard.svelte b/src/lib/components/cards/RacePickCard.svelte index dd6f50d..96f45e2 100644 --- a/src/lib/components/cards/RacePickCard.svelte +++ b/src/lib/components/cards/RacePickCard.svelte @@ -88,97 +88,89 @@ let dnf_select_value: string = $state(racepick?.dnf ?? ""); -{#await data.graphics then graphics} - {#await data.drivers then drivers} - (drivers, "id", racepick?.pxx ?? "")?.headshot_url ?? - get_driver_headshot_template(graphics)} - imgid="headshot_preview" - width="w-full sm:w-auto" - imgwidth={DRIVER_HEADSHOT_WIDTH} - imgheight={DRIVER_HEADSHOT_HEIGHT} - imgonclick={(event: Event) => modalStore.close()} +{#await Promise.all([data.graphics, data.drivers]) then [graphics, drivers]} + (drivers, "id", racepick?.pxx ?? "")?.headshot_url ?? + get_driver_headshot_template(graphics)} + imgid="headshot_preview" + width="w-full sm:w-auto" + imgwidth={DRIVER_HEADSHOT_WIDTH} + imgheight={DRIVER_HEADSHOT_HEIGHT} + imgonclick={(event: Event) => modalStore.close()} + > +
modalStore.close()} > - modalStore.close()} - > - - - {#if racepick && !disabled} - - {/if} + + + {#if racepick && !disabled} + + {/if} - - + + -
- - {#await active_drivers_and_substitutes then pxx_drivers} - + + {#await active_drivers_and_substitutes then pxx_drivers} + + P{data.currentrace?.pxx ?? "XX"} + + {/await} + + + {#await active_drivers_and_substitutes then pxx_drivers} + + DNF + + {/await} + + +
+ {#if racepick} + + {:else} + - - {:else} - - {/if} -
+ Make Pick + + {/if}
-
-
- {/await} + + +
{/await} diff --git a/src/lib/components/cards/RaceResultCard.svelte b/src/lib/components/cards/RaceResultCard.svelte index 2339592..f8fa07f 100644 --- a/src/lib/components/cards/RaceResultCard.svelte +++ b/src/lib/components/cards/RaceResultCard.svelte @@ -172,20 +172,18 @@
- {#await currentrace then current} - {#await pxxs_whitelist then whitelist} - - {/await} + {#await Promise.all([currentrace, pxxs_whitelist]) then [current, whitelist]} + {/await}
{#await pxxs_options then options} diff --git a/src/lib/components/cards/SubstitutionCard.svelte b/src/lib/components/cards/SubstitutionCard.svelte index ad1414b..7fffa57 100644 --- a/src/lib/components/cards/SubstitutionCard.svelte +++ b/src/lib/components/cards/SubstitutionCard.svelte @@ -56,104 +56,102 @@ let race_select_value: string = $state(substitution?.race ?? ""); -{#await data.graphics then graphics} - {#await data.drivers then drivers} - (drivers, "id", substitution?.substitute ?? "")?.headshot_url ?? - get_driver_headshot_template(graphics)} - imgid="headshot_preview" - width="w-full sm:w-auto" - imgwidth={DRIVER_HEADSHOT_WIDTH} - imgheight={DRIVER_HEADSHOT_HEIGHT} - imgonclick={(event: Event) => modalStore.close()} +{#await Promise.all([data.graphics, data.drivers]) then [graphics, drivers]} + (drivers, "id", substitution?.substitute ?? "")?.headshot_url ?? + get_driver_headshot_template(graphics)} + imgid="headshot_preview" + width="w-full sm:w-auto" + imgwidth={DRIVER_HEADSHOT_WIDTH} + imgheight={DRIVER_HEADSHOT_HEIGHT} + imgonclick={(event: Event) => modalStore.close()} + > +
modalStore.close()} > - modalStore.close()} - > - - - {#if substitution && !disabled} - - {/if} + + + {#if substitution && !disabled} + + {/if} -
- +
+ + + Substitute + + + + + For + + + + {#await data.races then races} - Substitute + Race + {/await} - - - For - - - - {#await data.races then races} - +
+ {#if substitution} + - - {:else} - - {/if} -
+ Save Changes + + + {:else} + + {/if}
- - - {/await} +
+ +
{/await}