diff --git a/frontend/src/lib/components/CategoryModal.svelte b/frontend/src/lib/components/CategoryModal.svelte index 687e6c7..e28706f 100644 --- a/frontend/src/lib/components/CategoryModal.svelte +++ b/frontend/src/lib/components/CategoryModal.svelte @@ -6,14 +6,14 @@ let modal: HTMLDialogElement; import { t } from 'svelte-i18n'; - import InformationSlabCircle from '~icons/mdi/information-slab-circle'; - export let categories: Category[] = []; let category_to_edit: Category | null = null; let is_changed: boolean = false; + let has_loaded: boolean = false; + onMount(async () => { modal = document.getElementById('my_modal_1') as HTMLDialogElement; if (modal) { @@ -21,6 +21,7 @@ } let category_fetch = await fetch('/api/categories/categories'); categories = await category_fetch.json(); + has_loaded = true; // remove the general category if it exists // categories = categories.filter((c) => c.name !== 'general'); }); @@ -77,25 +78,31 @@