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

@@ -14,22 +14,22 @@
import SettingAccordion from '$lib/components/shared-components/settings/setting-accordion.svelte';
// Folders
let foldersEnabled = $preferences?.folders?.enabled ?? false;
let foldersSidebar = $preferences?.folders?.sidebarWeb ?? false;
let foldersEnabled = $state($preferences?.folders?.enabled ?? false);
let foldersSidebar = $state($preferences?.folders?.sidebarWeb ?? false);
// Memories
let memoriesEnabled = $preferences?.memories?.enabled ?? true;
let memoriesEnabled = $state($preferences?.memories?.enabled ?? true);
// People
let peopleEnabled = $preferences?.people?.enabled ?? false;
let peopleSidebar = $preferences?.people?.sidebarWeb ?? false;
let peopleEnabled = $state($preferences?.people?.enabled ?? false);
let peopleSidebar = $state($preferences?.people?.sidebarWeb ?? false);
// Ratings
let ratingsEnabled = $preferences?.ratings?.enabled ?? false;
let ratingsEnabled = $state($preferences?.ratings?.enabled ?? false);
// Tags
let tagsEnabled = $preferences?.tags?.enabled ?? false;
let tagsSidebar = $preferences?.tags?.sidebarWeb ?? false;
let tagsEnabled = $state($preferences?.tags?.enabled ?? false);
let tagsSidebar = $state($preferences?.tags?.sidebarWeb ?? false);
const handleSave = async () => {
try {
@@ -50,11 +50,15 @@
handleError(error, $t('errors.unable_to_update_settings'));
}
};
const onsubmit = (event: Event) => {
event.preventDefault();
};
</script>
<section class="my-4">
<div in:fade={{ duration: 500 }}>
<form autocomplete="off" on:submit|preventDefault>
<form autocomplete="off" {onsubmit}>
<div class="ml-4 mt-4 flex flex-col">
<SettingAccordion key="folders" title={$t('folders')} subtitle={$t('folders_feature_description')}>
<div class="ml-4 mt-6">
@@ -116,7 +120,7 @@
</SettingAccordion>
<div class="flex justify-end">
<Button type="submit" size="sm" on:click={() => handleSave()}>{$t('save')}</Button>
<Button type="submit" size="sm" onclick={() => handleSave()}>{$t('save')}</Button>
</div>
</div>
</form>