chore(web): migration svelte 5 syntax (#13883)

This commit is contained in:
Alex
2024-11-14 08:43:25 -06:00
committed by GitHub
parent 9203a61709
commit 0b3742cf13
310 changed files with 6435 additions and 4176 deletions

View File

@@ -1,4 +1,4 @@
<script lang="ts" context="module">
<script lang="ts" module>
export interface SearchCameraFilter {
make?: string;
model?: string;
@@ -6,20 +6,21 @@
</script>
<script lang="ts">
import { run } from 'svelte/legacy';
import Combobox, { asComboboxOptions, asSelectedOption } from '$lib/components/shared-components/combobox.svelte';
import { handlePromiseError } from '$lib/utils';
import { SearchSuggestionType, getSearchSuggestions } from '@immich/sdk';
import { t } from 'svelte-i18n';
export let filters: SearchCameraFilter;
interface Props {
filters: SearchCameraFilter;
}
let makes: string[] = [];
let models: string[] = [];
let { filters = $bindable() }: Props = $props();
$: makeFilter = filters.make;
$: modelFilter = filters.model;
$: handlePromiseError(updateMakes());
$: handlePromiseError(updateModels(makeFilter));
let makes: string[] = $state([]);
let models: string[] = $state([]);
async function updateMakes() {
const results: Array<string | null> = await getSearchSuggestions({
@@ -47,6 +48,14 @@
filters.model = undefined;
}
}
let makeFilter = $derived(filters.make);
let modelFilter = $derived(filters.model);
run(() => {
handlePromiseError(updateMakes());
});
run(() => {
handlePromiseError(updateModels(makeFilter));
});
</script>
<div id="camera-selection">